cancel
Showing results for 
Search instead for 
Did you mean: 

htaccess file for htdocs folder also applied to domain?

oliverb
Grafter
Posts: 606
Registered: ‎02-08-2007

htaccess file for htdocs folder also applied to domain?

I have some content in the /htdocs folder of my webspace
I also have a domain hosted in a subfolder, with its own content.
how can I prevent redirect directives in /htdocs/.htaccess from affecting the domain name.
For example I'd like to move some content from the webspace to the domain but if I use a redirect at the moment it'll cause a loop.
3 REPLIES
Prod_Man
Grafter
Posts: 286
Registered: ‎04-08-2007

Re: htaccess file for htdocs folder also applied to domain?

Not 100% clear what your stabbing at,
but, I get the general idea of what your trying to acchieve. (I think)
Perhapse post a copy of your /htdocs/.htaccess. That would be a staring point.
also it depends alittle on how your indexes are coded/arranged, as well as Domain setup.
I get the idea that something is redirecting causing a constant loop, I've done it myself before.
It could be anywhere for all I know Tongue
Jim,
prichardson
Grafter
Posts: 1,503
Thanks: 1
Registered: ‎05-04-2007

Re: htaccess file for htdocs folder also applied to domain?

This is not easily possible with standard Apache directives.
Mod_Rewrite is installed though, so you can use this to filter out requests for the domain.
.htaccess has very poor inheritance in that all sub-directories have this file applied to them and there is no way to turn this off.
oliverb
Grafter
Posts: 606
Registered: ‎02-08-2007

Re: htaccess file for htdocs folder also applied to domain?

Sorry, must have missed the reply. Thanks for trying.
Yes I think mod_rewrite is the answer as it can be made domain-aware. Unfortunately it seems to depend on knowing your full directory path. I've had some success with hard redirects when the rewrite returns a url but I've never managed to remap directories properly.
mod_rewrite scares me...