-
Extra htaccess file
I have a wordpress site and use an htaccess file to do redirects. I noticed when I opened my website with Filezilla there is another htaccess file at the top level of my folders (the root I guess maybe).
So to be clear, when I open my website with Filezilla the top level folder is just a slash (/) then I go to the "public_html" folder and that is where my actual wordpress files are and the htaccess file that I created. This other htaccess file is at the same level as the "public_html" folder.
Here is the contents of the htaccess file in question, and my question is should I delete it? I do not know how it got there and what its purpose is. And question #2, if I do delete it, should I add the content to my real htaccess file?
<IfModule mod_deflate.c>
SetOutputFilter DEFLATE
<IfModule mod_setenvif.c>
# Netscape 4.x has some problems...
BrowserMatch ^Mozilla/4 gzip-only-text/html
# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip
# MSIE masquerades as Netscape, but it is fine
# BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
# NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48
# the above regex won't work. You can use the following
# workaround to get the desired effect:
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
# Don't compress images
SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary
</IfModule>
<IfModule mod_headers.c>
# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary
</IfModule>
</IfModule>
Thanks - Travis
-
The highest level is first, anything below that over rides what is above it...
But, only opposing command over ride, anything not opposed continues downstream.
so you could have deny all in root, but have allow all in html root and everyone can visit.
-
OK thanks. So the lower one that has my redirects should (and does) work right? Should I just delete the one that has the info above? Im not sure what that even is doing?
-
Well the higher one you posted is telling it to compress items and to not alter user agents from browsers, I would not change that unless you are handling that at a lower level or in another way.
-
OK Thanks. So the bottom line I guess is the extra file is not going to hurt anything..... I just need to be aware the lower level file will override the higher level one.
-
Only over rides if it conflicts with the higher one! Otherwise all settings flow down through all levels