Welcome to WebmasterWorld Guest from 54.196.238.210

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

excluding certain files from modrewrite rule

     

fasteddie uk2001

10:16 am on Jun 23, 2004 (gmt 0)

10+ Year Member



Hi

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

jdMorgan

3:40 pm on Jun 23, 2004 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member



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]

Jim

fasteddie uk2001

5:19 pm on Jun 23, 2004 (gmt 0)

10+ Year Member



Cheers Jim

Will try it out tomorrow and see how it goes.

Thanks again.

f

 

Featured Threads

Hot Threads This Week

Hot Threads This Month