homepage Welcome to WebmasterWorld Guest from 54.197.189.108
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
excluding certain files from modrewrite rule
fasteddie uk2001




msg:1517408
 10:16 am on Jun 23, 2004 (gmt 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

 

jdMorgan




msg:1517409
 3:40 pm on Jun 23, 2004 (gmt 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

fasteddie uk2001




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

Cheers Jim

Will try it out tomorrow and see how it goes.

Thanks again.

f

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved