Msg#: 4262117 posted 6:49 am on Feb 3, 2011 (gmt 0)
for a new software module we want to use a combination of .htaccess and mod_rewrite.
However we are unsure how many hosting service providers support this combination - i.e. the ability to run .htaccess and mod_rewrite.
I have been told by programmers that these two functions are and have always been ON by default on Apache servers - so that basically almost anyone these days using an Apache based hosting account (virtual or not)has these functions supported.
Is this correct? Or are the programmers optimistic?
Is there any way to find out if most hosting companies turn off these functions for security reasons?
Any advice or direction on where I can find more info would be much appreciated.
Msg#: 4262117 posted 8:35 am on Feb 4, 2011 (gmt 0)
I would think that in all current Apache installations, .htaccess and mod_rewrite are supported. If are using a shared hosting service, it may be that only a subset of all .htaccess commands is enabled. On a virtual or dedicated server account you are in full control of the functionality of .htaccess and mod_rewrite.
Msg#: 4262117 posted 1:00 am on Feb 6, 2011 (gmt 0)
Thanks for this answer. But are .htaccess and mod_rewrite enabled by default when installing Apache? The problem we have is that our customers may not have access to their server settings, as they only have basic hosting accounts. If mod-rewrite is not on by default, it may not be enabled - which would be an issue. Or if hosting companies turn it off for security reasons. :) Steffan
Msg#: 4262117 posted 8:11 pm on Feb 8, 2011 (gmt 0)
In my experience from years gone by (say 5-7 years ago), many shared hosting environments required you to ask to have the AllowOverride turned on for a given account (this may have changed, but a few years ago when I was doing sites for people on a lot of different hosting providers, this came up a fair bit).
Now that so many people are just installing Wordpress, I haven't run into that in a very long time and even back when I used to encounter that, I never ran into a host that wouldn't turn it on.
This isn't turned off for security reasons, but for performance. Imagine I have a URL like this
That's not out of the question for a CMS - you can easily end up with something 5-8 levels deep.
Now the server can't know which rules to apply until it recurses up the entire directory structure and finds and reads every .htaccess file. Note, this is true even if there ARE none. So hosts sometimes don't like to turn it on unless someone needs it.
So instead of
Give me example.com/user/3/images/2010/01/thumbnails/image_tn.jpg
The server has to ask
-does example.com/user/3/images/2010/01/thumbnails/.htaccess exist? If so read it and remember its rules -does example.com/user/3/images/2010/01/.htaccess exist? If so read it and remember its rules -does example.com/user/3/images/2010/.htaccess exist? If so read it and remember its rules -does example.com/user/3/images/.htaccess exist? If so read it and remember its rules -does example.com/user/3/.htaccess exist? If so read it and remember its rules -does example.com/user/.htaccess exist? If so read it and remember its rules -does example.com/user/.htaccess exist? If so read it and remember its rules -does example.com/.htaccess exist? If so read it and remember its rules - okay, let me process all those rules - hmmm... none apply - Give me example.com/user/3/images/2010/01/thumbnails/image_tn.jpg
Now think of the 250 sites typically sitting on a shared server. As a hosting company do you want to do this for the 25 that need it? Do you want to do this for the 200 that need it?
I think these days, it's more likely for 100 or more sites on the server to need it, so at that point, it costs more in support tickets than they save in hardware.
Msg#: 4262117 posted 2:08 pm on Feb 13, 2011 (gmt 0)
Your programmers are right.
Almost all Linux hosting providers allow mod_rewrite. In fact it is often cited as the biggest advantage Apache has over other http servers. However if you want to be absolutely certain you can always email a prospective hosting provider before purchasing hosting.