homepage Welcome to WebmasterWorld Guest from 54.166.255.168
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

    
301 non-www to www except for one directory
Need to let requests for one directory pass through without redirecting
CernyM

10+ Year Member



 
Msg#: 4280727 posted 5:11 pm on Mar 12, 2011 (gmt 0)

We've recently migrated our website technology to a new platform and have set up a CNAME record to point www.example.com to the new server.

The A record for example.com points at our old server and we use the following .htaccess to redirect requests for example.com to the new site.

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example\.com
RewriteRule ^(.*)$ http://www.example.com/$1 [R=permanent,L]


We'd like requests for example.com/images to pass through without any 301 redirects though. Can anyone give me pointers on how to modify our .htaccess to accomplish this?

 

g1smd

WebmasterWorld Senior Member g1smd us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4280727 posted 8:36 pm on Mar 12, 2011 (gmt 0)

Place this condition ahead of the existing ruleset:
RewriteCond %{REQUEST_URI} !/images
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