Forum Moderators: phranque
I'm hoping that someone can help me. I'm moving a lot of files from one site to a new URL so want to use modrewrite to point the old files to the new ones.
I would normally use the following if I wanted everything to point across, but I'd like a few files (index.html, contact.html etc) not to move.
RewriteBase /
RewriteCond %{HTTP_HOST} extradomain2.co.uk$
RewriteRule ^(.+) [realdomain.co.uk...] [L,R=301]
Is there a simple syntax for excluding some pages from moving, or would I be better off just trying to move all the other files and folders instead.
Many thanks
f
> but I'd like a few files (index.html, contact.html etc) not to move
RewriteBase /
RewriteCond %{HTTP_HOST} ^(www\.)?extradomain2\.co\.uk
RewriteCond %{REQUEST_URI} !^/index\.html$
RewriteCond %{REQUEST_URI} !^/contact\.html$
RewriteCond %{REQUEST_URI} !^/etc\.html$
RewriteRule (.*) http://www.realdomain.co.uk/$1 [L,R=301]