MyBB Community Forums

Full Version: htacces.txt file in Upload folder
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I stumbled across this little thing when solving a ticket for a client at The Forum Forge. I am not even sure if this is done on purpose or not but the MyBB 1.4.11 installation comes with a htaccess.txt which should be a .htaccess.

Now this might not be a big deal but when installing MyBB the "Enable search engine friendly URLs?" option is on Automatic Detection and if that is a yes than your posts, threads, categories, and profile links won't work and if you don't know this you could be spending some quality time in looking for a solution that is as simple as renaming a single file.

Anyway It would be nice to see the htaccess.txt file in the Upload folder to be changed to .htaccess.
It is done this way on purpose - with some people's configurations our .htaccess file may cause problems if named .htaccess. Calling it htaccess.txt ensures that people can easily rename it and make use of it if they can/want to but doesn't create problems for those that do not want it/cannot use it.
[Wiki: SEF_URLS] (Broken link, head over to docs.mybb.com instead)
(2010-02-21, 12:25 AM)Zomaian Wrote: [ -> ]Now this might not be a big deal but when installing MyBB the "Enable search engine friendly URLs?" option is on Automatic Detection and if that is a yes than your posts, threads, categories, and profile links won't work and if you don't know this you could be spending some quality time in looking for a solution that is as simple as renaming a single file.

I have to agree with this actually.

if($mybb->settings['seourls'] == "yes" || ($mybb->settings['seourls'] == "auto" && $_SERVER['SEO_SUPPORT'] == 1))

This says that if they're set to auto and the server supports SEO, it'll give the cleaner URLs. I looked on php.net at the $_SERVER page and SEO_SUPPORT wasn't listed there so I may need to be told what it actually means if it = 1. Does that mean the server supports all the extensions etc needed for SEO, such as mod_security etc?? Will that still be 1 if there is no .htaccess?? If it can be 1 before you've renamed the file, then it would cause a problem because it would be using the shorter URLs without the .htaccess. There have been a lot of people who have made support threads about going to a 404 straight after installing, it never made any sense until I looked at the code. I agree it should be htaccess.txt to begin with but if SEO_SUPPORT can be 1 without a .htaccess file, then I'd suggest having the SEF URLs setting disabled to begin with.
(2010-02-21, 01:04 AM)MattRogowski Wrote: [ -> ]I looked on php.net at the $_SERVER page and SEO_SUPPORT wasn't listed there so I may need to be told what it actually means if it = 1.
It's because it isn't there. It's set through htaccess environment variables, which is why that code works.
And if it's not set, PHP defaults to "null", not 1.
Well after the install the clients admin panel worked fine so I was able to easily to disable it or enable it but maybe have a option in the installation to enable/disable or create a .htaccess or just simple have it disabled after the install instead of auto detect. My problem isn't that its hard or takes a lot of time to change in fact it took me 3 seconds but for people that don't know this can be tinkering for hours with it by searching on Google, posting threads here, and open tickets with their host.

Anyways I just wanted to know your (MyBB community) take on this subject Wink.

Edit:

(2010-02-21, 01:04 AM)MattRogowski Wrote: [ -> ]
if($mybb->settings['seourls'] == "yes" || ($mybb->settings['seourls'] == "auto" && $_SERVER['SEO_SUPPORT'] == 1))
Does that mean the server supports all the extensions etc needed for SEO, such as mod_security etc?? Will that still be 1 if there is no .htaccess??
It only looks at the server settings not if you have a .htaccess which is the problem.
^ You don't want to be checking for whether .htaccess exists. For one, it means that you need to hard code modifications if using a server which doesn't use .htaccess (eg editing Apache config files).
I believe there was some issues with sticking .htaccess by default, which is why it's named htaccess.txt.