Changing the root index.php file name

Started by Goad, January 10, 2022, 11:02:12 PM

Previous topic - Next topic

Goad

Is it possible to change the root index.php to something else like forum.php?

Side note: I am using prettyurls too

Kindred

In short, no. Doing so will do bad things
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Goad

I know I cant just rename the file and hope for all things to work normally.

Is there changes I can do to the system to get it to work if I change it?

Aleksi "Lex" Kilpinen

I'm curious - What is your motivation for this?
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Arantor

Quote from: Goad on January 11, 2022, 10:54:04 AMI know I cant just rename the file and hope for all things to work normally.

Is there changes I can do to the system to get it to work if I change it?

That depends if you want to break the site theme for the first visit a user has, because that is one of the side effects of doing it.

And if the effect is to sidestep around WordPress even worse things will happen. Ditto if used with Pretty URLs.

It's not supported and the effort required to properly support it is annoyingly high.

This also presumes your mods are all properly written...

Goad

So I am trying to run Wordpress and SMF out of the root.

I have a 15+ year old SMF forum that has been running on the root of my domain. I love SMF n all, but lets be real, its front end with whatever portal you use is seriously dated and limited. If I move SMF to /forum/ then I loose all my years and years of back links.

SOOO.....I came up with a different solution. I renamed the index.php for wordpress to home.php (which is totally fine and works), then changed my apache settings to default to home.php first, then index.php second. I just successfully did this on a test site and everything seems to be working fine. Looking to pull the trigger on my production site tonight.

I still get to keep my backlinks, even if its not a pretty url link (ex: domain.com/index.php?topic=4523452) but I get to run a much more robust front end.

Anyone foresee any issues that I maybe have not run into on my test site?

Kindred

Lots and lots of issues

WordPress does not share services well

Why did you install then in the same directory?? Just put the forum in a subdirectory and avoid many problems
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Goad

I given the reason why.....15+ years of back links will be broken if I move SMF into /forum/ or to a sub domain.

Explain what issues would arise? I copied my full live production SMF forum to my test site and it is running fine along side WP in the same root folder together. Tested posts with/without attachments, even tested with/without prettyurls enabled. Browsed boards, threads, and posts with no issues.

Dont just tell me "lots and lots of issues" without stating reasons/facts. I am not arguing here, just want to know what I am up against.

shawnb61

In short, you are now fighting a two-front war.

On the first front, renaming index.php...  "index.php" is used well over a hundred times  throughout the core SMF code.  You would need to review all of them, change, & test.  And each of those individual changes would likely make it more difficult to install mods, etc.  And SMF patches, too, btw, which is a big deal.  A lot of work, with guaranteed issues, then followed with a long-term headache.  If you get it to work at all.  You've been given good advice above: don't do it.

On the second front, Wordpress...  You should probably read a couple dozen threads on WP integration.  In general, it always poses challenges.  How do you sum of lots & lots of issues?  By saying "lots and lots of issues"...  If you want more details, you may want to do some searches here.  Find some examples & approaches that worked.

Note that the "15+ years of back links" problem OTOH, is easily solveable.  Lots of folks simply do a REPLACE using sql.  This is a pretty common need after a forum move.  Do backups & tests first, of course.  And that approach is waaaaayyyyy more easily and safely done than renaming index.php... 

I use the following utility to change URLs and directories after a forum move, to easily make test copies of forums, and move them into subfolders with all links and mod settings intact.  Exactly what you're describing.  It might be of help - https://github.com/sbulen/sjrbTools/blob/master/smf_urls_paths.php.  Use with caution.  Backups, backups, backups...  If you break something & cannot restore, that's on you...
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Goad

shawnb61: as stated previously I abandoned the idea of changing SMF's index.php. I changed WP's index.php to home.php, then edited my apache settings to make home.php the first index, then index.php the second.

This is currently working fine on my test site. What issues am I missing?

WordPress: https://test2.socaljetboats.com (header links to the forum aren't accurate, I know)

SMF forum: https://test2.socaljetboats.com/index.php

shawnb61

Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Advertisement: