so we had a development site up for example: test.domain.com/dev/filename.html and its been indexed by Google so i need to redirect them to http://www.newdomain.com/filename.html but not just files but also folders/files like.
test.domain.com/dev/example/filename.html
or
http://www.newdomain.com/example/example/filename.html
to
http://www.newdomain.com/filename.html
note that the /dev/ folder on test domain cannot be pushed on the redirect?
Anyone have any ideas on this?
i have tried:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !test.domain.co.uk/dev/$ [NC]
RewriteRule ^(.*)$ http://www.newdomain.com/$1 [L,R=301]
after some tests this redirects to http://www.newdomain.com/dev/page.html and i need to remove the /dev/ …..
and some other options while hunting around but nothing yet meet the requirement.
Thanks in advance
You also need RewriteCond so try: