Support

Admin Tools

#16017 Two similar sites, htaccess maker creating different htaccess

Posted in ‘Admin Tools for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
n/a
PHP version
n/a
Admin Tools version
n/a

Latest post by nicholas on Thursday, 09 May 2013 10:18 CDT

user12942
Mandatory information about my setup:

Have I read the related troubleshooter articles above before posting (which pages?)? YES/Trouble accessing site
Have I searched the tickets before posting? YES
Have I read the documentation before posting (which pages?)? No
Joomla! version: 2.5.11
PHP version: 5.3.23 (exactly the same config on both sites)
MySQL version: (unknown)
Host: (Heart)
Admin Tools version: 2.5.4

Description of my issue:
I have two similar simple sites with almost everything installed the same via the same shared hosting provider (but on different shared servers), only a gallery style thing and a file explorer installed on one that isn't on the other. I have created an htaccess file for each site using exactly the same setting except for jw_sigpro in the fine tuning and Watchfulli & extplorer in Exceptions on one of the sites. All other Admin Tools settings are the same and both sites are running Apache 2.4.4 yet I'm getting two different htaccess files created?

The problem came to light when one of the sites stopped working with a 500 Internal Server Error it seems after the hosting provider upgraded Apache on May 1st. I have fixed the broken site by turning off the "Follow symlinks" option in .htaccess Maker, but it doesn't explain why the other sites with "Follow symlinks" are still working.

To try and find the problem, when comparing the created htaccess files I note the following differences and wonder if this is what's causing the issue with the site that no longer works (and I wonder why the two files are created equal but end up different):

Site that still works with +FollowSymLinks:
-------------------------------------------------------
### Auto-detected Apache version: 2 (best guess)

RewriteRule ^index\.php$ http%2://www.failingsite.com/ [R,L]

RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R,L]


Site that doesn't:
---------------------------------------------------------
### Auto-detected Apache version: 2.2 (best guess)

RewriteRule ^index\.php$ http%2://www.okaysite.co.uk/ [R=301,L]

RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

---------------------------
This section is completely missing in the site that still works
---------------------------
##### Automatic compression of resources -- BEGIN
<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/plain text/xml text/css application/xml application/xhtml+xml application/rss+xml application/javascript application/x-javascript
</ifmodule>
<ifModule mod_gzip.c>
mod_gzip_on Yes.....
*ETC, EDITED OUT TO SAVE SPACE*.....
mod_gzip_item_exclude mime ^image/.*
</ifmodule>
##### Automatic compression of resources -- END
---------------------------------

So, any suggestions as to what's going on? Why the htaccess differences and why one site started failing when it had been fine for ages without any changes?

(NB I've just been informed that the FollowSymLinks isn't required on those servers so I can turn it off, but that doesn't solve the differences problem)

nicholas
Akeeba Staff
Manager
I believe that you have already answered your own question without realizing it. If you take a look at the information you posted you will realize that a different Apache version was detected on each site. As a result, the generated .htaccess file is slightly different for each site. This is normal. It is exactly the reason why we are doing Apache version detection.

There is a corollary to that. Your site seem to be hosted on different servers. Just because you're using the same hosting provider doesn't automatically mean that all of your sites and up on the same server. Also, using the same hosting provider doesn't mean that all of its servers are configured exactly the same. In fact, it is very, that different servers belonging to the same provider but to service in different times have a different configuration.

As a result, I do not see any issue that you require support for. It is all working normally, with the proper .htaccess file generated, depending on the Apache version of the server the site is installed on.

Nicholas K. Dionysopoulos

Lead Developer and Director

πŸ‡¬πŸ‡·Greek: native πŸ‡¬πŸ‡§English: excellent πŸ‡«πŸ‡·French: basic β€’ πŸ• My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

user12942
I did wonder if the Apache detection was making the difference which is why I didn't neglect to include that, and of course I'm relying on my hosting company telling the truth when they say both of their servers have been updated to Apache 2.4.4. - (However Admin Tools is detecting v2 & v2.2)

I've been hassling them about the problem for hours now and they still keep telling me its a problem with my htaccess file despite the fact other sites on their servers are still working with almost identical htaccess details.

It seems the site in question was unavailable to the world for the last 9 days and I'm just trying to get to the bottom of things so that it doesn't happen again.

Thanks for your previous speedy and useful reply.

nicholas
Akeeba Staff
Manager
The detection code will read the $_SERVER['SERVER_SOFTWARE'] superglobal key and parse it. We detect the following specific versions: 1.3, 2.0, 2.2. If the version string doesn't match one of those we use PHP's version_compare() to compare it to 1.3. If it's lower than 1.3 we pretend we detected version "1.1". Otherwise we pretend we detected version "2.2". There is only one catch. If the server version string is "Apache", not followed by a slash, we assume it's version 2.0.

As a result, if the Apache 2.4 server doesn't report its version number we end up detecting it as 2.0, with everything that means about the .htaccess generation. If this is the case, just ask your host to have Apache report its full version to PHP in the $_SERVER['SERVER_SOFTWARE'] superglobal.

Nicholas K. Dionysopoulos

Lead Developer and Director

πŸ‡¬πŸ‡·Greek: native πŸ‡¬πŸ‡§English: excellent πŸ‡«πŸ‡·French: basic β€’ πŸ• My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

user12942
Just a quick update, The server people owned up that they gave me the wrong information about Apache versions installed on the two servers concerned, they are different and partially explains what was going on with the problems I'm having with them!.

Thanks for your help in identifying the issues and explaining how AT works some of its magic.

nicholas
Akeeba Staff
Manager
You're welcome and thank you for the feedback! This explains why a different .htaccess file was generated.

Nicholas K. Dionysopoulos

Lead Developer and Director

πŸ‡¬πŸ‡·Greek: native πŸ‡¬πŸ‡§English: excellent πŸ‡«πŸ‡·French: basic β€’ πŸ• My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!