Help - Search - Members - Calendar
Full Version: htaccess Questions
Hostony Board > General Support > General Support
DPerdue
This might be a more appropriate post on an Apache forum, but here goes.

My add on domains appear as subfolders in my main domain. This means however, that any change I make to the htaccess file in my main domain will apply to all my add on domains. This is especially troubling with redirects. If i specify a redirect like this:

CODE
RedirectTemp /folder1/  http://mysite.com/folder2/


then it will atutomatically forward all http://addondomain.com/folder1/ to http://mysite.com/folder2/ and I don't want this to happen.

So here's the question(s): Is there a way to get a clean start on an htaccess file on sub folder? Is there a different way to specify the redirects so that it will work the way I want it to?
Alexandre
The problem is because of trailing slashes. Using the example above:

http://www.domain2.com/dir
will redirect to http//d2.domain1.com/dir

but:

http://www.domain2.com/dir/
Works fine.

In the subdirectory for the domain (e.g. test for www.domaintest.com) you can create an htaccess file with this in it:

RewriteEngine on
RewriteBase /test/
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+[^/])$ $1/ [R]

But obviously change 'test' to the name of the directory you're using.
DPerdue
The problem with that is if I go to domain2.com/dir/ it still goes back to my domain1.com. domain2.com/dir works like it should but not with the trailing slash.

Is there a way to use the <DirectoryMatch> directive inside an htaccess to restrict the htaccess directives to all directories accept those that I want it to affect?
Vanya
Open a ticket on this. domain2.com/dir/ shoud work ok.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2024 Invision Power Services, Inc.
IPS Driver Error

IPS Driver Error

There appears to be an error with the database.
You can try to refresh the page by clicking here