Welcome to WebmasterWorld Guest from 54.146.221.231

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

excluding certain files from modrewrite rule

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

Junior Member

10+ Year Member

joined:Nov 27, 2003
posts:75
votes: 0


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

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

Senior Member

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

joined:Mar 31, 2002
posts:25430
votes: 0


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
5:19 pm on June 23, 2004 (gmt 0)

Junior Member

10+ Year Member

joined:Nov 27, 2003
posts:75
votes: 0


Cheers Jim

Will try it out tomorrow and see how it goes.

Thanks again.

f

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members