homepage Welcome to WebmasterWorld Guest from 54.242.18.190
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld
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




msg:4280729
 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




msg:4280809
 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