Welcome Guest, Not a member yet? Register   Sign In
rewrite rules in httpd.conf rather than .htaccess
#1

[eluser]chrisco23[/eluser]
I use the method that most of you probably use to keep index.php from showing in the URL: rewrite rules in .htaccess

Someone told me it's faster to put this kind of thing in httpd.conf than in an .htaccess file. My question is:

1. Is it true? Seems to make sense to me. That way it wouldn't have to touch .htaccess every time. Probably performance difference is negligible though?

2. Is it possible? Is it even possible to put these rewrite rules that we use to keep index.php out of the URL, in httpd.conf


Thanks,
Chris
#2

[eluser]Crafter[/eluser]
Your directives will work perfectly in httpd.conf, even if you have an .htaccess file and provided you are not overwriting directives. The .htaccess method is a convenient way of not having to change the entire web server settings for specific sites and directories, which becomes important if you are hosting multiple sites,

As to whether it's faster, I cannot say. You probably need to examine your web server to detirmine that, But as you said it, I would tend to agree that performance would be negligible, unless your site has specific performance requirements.
#3

[eluser]Craig A Rodway[/eluser]
Yes, apparently it is faster; which makes sense if Apache doesn't have to A) check for a .htaccess file in the directory and B) parse it. But from discussions, and as Crafter says, the small performance increase is negligible.

Although I would still recommend if you have a large-ish htaccess file, many rules and is not changed often - stick it in your main Apache conf file and turn AllowOverride to 'None'.




Theme © iAndrew 2016 - Forum software by © MyBB