htaccess redirect

Soldato
Joined
18 Oct 2002
Posts
9,047
Location
London
I'm using this so that if any old links that are around go to the 'newer' address of gallery.dom1.

RedirectMatch permanent ^/gallery/(.*)?$ http://gallery.dom1.com/$1

However I have an addon domain and I want to use a subdir called gallery on that, such as: dom2.com/gallery/

However the redirect kicks in and sends me to gallery.dom1.com!

How can I change the redirect so that it only works for dom1, and not dom2. IF that makes sense!
Thanks for any help :)
 
Thanks for that, but I get a 500 error from this:

<Directory /home/me/public_html> (or public_html/gallery)
RedirectMatch permanent ^/gallery/(.*)?$ http://gallery.dom1.com/$1
</Directory>

Also it says this:
<Directory> and </Directory> are used to enclose a group of directives which will apply only to the named directory and sub-directories of that directory
- Doesn't that mean that it would work for my dom2 subdirectory too?
 
Back
Top Bottom