CodeIgniter Forums

Full Version: rewrite rules in httpd.conf rather than .htaccess
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

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


El Forum

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.

El Forum

[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'.