Welcome to WebmasterWorld Guest from 54.159.44.227

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Mod rewrite except for one directory

     

JohnKelly

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

10+ Year Member



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]

jdMorgan

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

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



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.

Jim

JohnKelly

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

10+ Year Member



Good point, I'll check the WP config.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month