• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.2 Change index.php to another URL

Adam K M

Active member
#1
Hello!

My friends and I are currently trying to make our forum index go from "index.php" to "forums.php" in the same directory...
i.e. Forum Category list can be found myurl.com/forums.php instead of myurl.com/index.php

We want to make our own custom home page... though due to the nature of one of our add-ons, we can not afford to move the forums to another folder.

Thanks!
 

Jake Bunce

XenForo moderator
Staff member
#2
You can try modifying library/XenForo/Link.php. Search for and change "index.php" in that file. In the case of friendly URLs you also need to modify the .htaccess file. Untested, but those are the two instances of "index.php" that come to mind.
 

Eagle

Well-known member
#3
You can try modifying library/XenForo/Link.php. Search for and change "index.php" in that file. In the case of friendly URLs you also need to modify the .htaccess file. Untested, but those are the two instances of "index.php" that come to mind.
That's awesome and working good but now getting the error "The server responded with an error. The error message is in the JavaScript console." when click smilies icon on editor panel.
 

Chris D

XenForo developer
Staff member
#4
Unfortunately index.php is hardcoded into some URLs in some locations (usually AJAX requests). I would advise against modifying references to that file.

If you absolutely had to you'd have to search through all files (including .js files) and update references to index.php there too. You'd have to remember to reapply those changes after upgrades. There's no guarantee that some add-ons won't also rely on index.php being called index.php too. I know there's some Xen Media Gallery stuff that calls upon index.php.

I'd strongly recommend a different approach.
 

Eagle

Well-known member
#5
Unfortunately index.php is hardcoded into some URLs in some locations (usually AJAX requests). I would advise against modifying references to that file.

If you absolutely had to you'd have to search through all files (including .js files) and update references to index.php there too. You'd have to remember to reapply those changes after upgrades. There's no guarantee that some add-ons won't also rely on index.php being called index.php too. I know there's some Xen Media Gallery stuff that calls upon index.php.

I'd strongly recommend a different approach.
That is correct and agreed. Now I've changed bb_code_edit.js file, search for "index.php" and rename to "forum.php" and problem solved. However, all js files should be change because it will big a problem when upgrade forum. What's your another suggest? How to use XF and WP in the same ftp root? Thanks.
 

Chris D

XenForo developer
Staff member
#6
I don't really have any experience when it comes to WordPress so I'm not sure. I don't think what you're trying to do is possible.
 

Eagle

Well-known member
#7
Well then, thank you Chris :) I think we'll move our forums to ./forum/ folder or another different approach. Thanks again.
 

Mike

XenForo developer
Staff member
#8
I think we'll move our forums to ./forum/ folder or another different approach.
I was going to suggest that. The difference would be forum.php?threads/xyz.123/ vs forum/threads/xyz.123/ -- the latter seems better and sorts all the issues. (And I'd often recommend naming the directory "community" so you don't have forum/forums/123.)