Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.htaccess files should only be used as a last resort #169

Closed
AD7six opened this issue Oct 31, 2010 · 3 comments
Closed

.htaccess files should only be used as a last resort #169

AD7six opened this issue Oct 31, 2010 · 3 comments

Comments

@AD7six
Copy link
Member

AD7six commented Oct 31, 2010

Taken from http://httpd.apache.org/docs/2.0/howto/htaccess.html

"In general, you should never use .htaccess files unless you don't have access to the main server configuration file."

Htaccess files themselves are a performance hit, probably most people reading this ticket already know that if a request is received for:

/var/www/vhosts/somedomain/htdocs/foo/bar/zum/index.html

all of these paths are checked for a htaccess file

/var/www/vhosts/somedomain/htdocs/foo/bar/zum/.htaccess
/var/www/vhosts/somedomain/htdocs/foo/bar/.htaccess
/var/www/vhosts/somedomain/htdocs/foo/.htaccess
/var/www/vhosts/somedomain/htdocs/.htaccess
/var/www/vhosts/somedomain/.htaccess
/var/www/vhosts/.htaccess
/var/www/.htaccess
/var/.htaccess
/.htaccess

That's a lot of file access for every request, especially if it's infact unnecessary because you have access to put your request logic in the config file. Therefore I suggest adding a simple header to the htaccess file along the lines of:

# NOTE      .htaccess files are an overhead, this logic should be in your apache config if at all possible
# see http://httpd.apache.org/docs/2.0/howto/htaccess.html for more information
@paulirish
Copy link
Member

Yup I like it..

definitely would like to promote httpd.conf -- though folks on many shared hosts (like dreamhost, etc) don't have access to that. so it's a soft suggestion. :)

do you want to file a pull req?

@AD7six
Copy link
Member Author

AD7six commented Oct 31, 2010

Done, I was expecting some debate :)

As the pull request is a seperate issue I'm going to close this ticket (or try to..).

@paulirish
Copy link
Member

I'll tweak the text a little to be a little bit more clear about httpd.conf and shit but in general you're totally right. :)

thx man

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants