Question

I am using RewriteMatch to redirect all traffic from subdir1 to subdir2, while keeping all other parts of the url the same. So for instance,

http://www.mydomain.com/subdir1/

would redirect to

http://www.mydomain.com/subdir2/

I am using this rule:

RedirectMatch 302 /subdir1/.* /subdir2/$1

which works for the url

http://www.mydomain.com/subdir1/

but not for any pages with longer urls. So it is not matching

http://www.mydomain.com/subdir1/index.htm

which should be redirected to

http://www.mydomain.com/subdir2/index.htm

If anyone has any ideas, I'd appreciate it.

Was it helpful?

Solution

Does this thread help at all? http://www.webmasterworld.com/forum92/4097.htm

OTHER TIPS

You would need to round brackets around your .*

RedirectMatch 302 /subdir1/(.*) /subdir2/$1

Without that $1 is meaningless and is not going to 'know' what to match on.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top