I want accesses to e.g. http://www.thisdomain.com/docs/path1/path2 to redirect to http://www.thatdomain.com/path1/path2
(Note that docs is not a part of the new path)
I have the following on http://www.thisdomain.com:
RewriteEngine on
RewriteRule ^docs/* http://www.domain.com/ [R=301,L]
If I access http://www.thisdomain.com/docs, it directs to http://www.thatdomain.com, but if I access a child-path like http://www.thisdomain.com/docs/path1/path2 it fails. Is it possible for the redirect to intercept the child-path access and redirect as I need? If so, any pointers?
Thanks.
With regular expressions, * means any number of the previous atom, which will match /docs and /docs/. Try this:
(
QSAis query string append, so/docs/foo?bar=bazwon’t lose the?bar=baz.)