homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

Mod rewrite except for one directory

 3:44 pm on Apr 9, 2009 (gmt 0)

I'm using mod_rewrite to redirect non-www requests to the www URL, as below:

RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.example\.com [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L,QSA]

However, after installing Wordpress I find it is caught in a redirect loop because of this. SO how can I exclude the /wordpress directory from the rewrite conditions above?

[edited by: jdMorgan at 4:21 pm (utc) on April 9, 2009]
[edit reason] No URLs. Please see Terms of Service. [/edit]



 4:24 pm on Apr 9, 2009 (gmt 0)

That's the wrong question to be asking. The correct question --I suspect-- is "Why is my WordPress install forcing requests to "example.com" instead of "www.example.com" and interacting with my RewriteRule to create a loop.

I don't use WP, but I suspect a simple WP configuration error: example.com was specified when www.example.com should have been used.



 4:34 pm on Apr 9, 2009 (gmt 0)

Good point, I'll check the WP config.

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