Forum Moderators: phranque

Message Too Old, No Replies

.htaccess override?

Can I use one single .htaccess for a whole site?

         

adsensejoe

1:01 pm on Sep 17, 2005 (gmt 0)

10+ Year Member



I currently have 4 htacess files placed in 4 different subfolders. Is it possible to combine them into one single htaccess in my root dir?

Actually, I just tried that, but the subdomains doesn't seem to read the root htaccess file. Do I need to change other settings as well, eg httpd.conf?

jdMorgan

3:57 pm on Sep 17, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It sounds like you've used a 'control panel' to 'define' the subdomains, or configured httpd.conf, such that requests for subdomains access a different document_root. In order for an .htaccess file to apply to all subdomains, they will all have to have that file in their directory-path. In other words, the change would be to point all subdomains to the same document_root as your main domain, do the necessary rewriting, and then sort out the subdomains after that (also using the .htaccess file).

Jim

adsensejoe

4:28 pm on Sep 17, 2005 (gmt 0)

10+ Year Member



Thanks for the reply!

It's not subdomains tho, they are simply subfolders (folders located below the root, eg /folder1, folder2/ etc)...

jdMorgan

4:35 pm on Sep 17, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Sorry, read too many threads in a day...

In that case, this should work be default, as long as you modify the relocated code to work in its new home. Any references to URL-paths or directory-paths may need to be updated.

Jim