Submitted by gregc@netoverdr... on Tue, 09/18/2012 - 08:56
Hi,
I thought that .htaccess would only apply within the document root. But i've just discovered that a .htaccess file in the /home directory will be applied to all websites.
Can you explain how this is happening? (ie virtualmin feature, apache config etc)
Status:
Closed (works as designed)
Comments
Submitted by andreychek on Tue, 09/18/2012 - 09:17 Comment #1
Howdy -- Apache looks for a .htaccess file in all directories leading up to where the script you're calling is.
So if a .htaccess file is in /, /home, or /home/username, Apache would use that.
Submitted by JamieCameron on Tue, 09/18/2012 - 13:23 Comment #2
Yes, that is expected behavior. Only the root user should be able to create a
.htaccess
file in the/home
directory though..Submitted by gregc@netoverdr... on Thu, 09/20/2012 - 08:37 Comment #3
thank you - It it obviously my ignorance on these matters.
I can see you are correct as per the apache documentation.
http://httpd.apache.org/docs/current/howto/htaccess.html
Thank you for your help in clarifying this for me.
Submitted by JamieCameron on Thu, 09/20/2012 - 11:15 Comment #4