...

View Full Version : .htaccess exception...



bencharity
01-24-2009, 06:08 PM
I posted a bit ago asking about a redirect from mysite.com to www.mysite.com and got it working. Now however this seems to be breaking my blog (wordpress).

Again I'm very new to htaccess, but is there a way to redirect all my site as above except a certain subfolder (eg. /blog/)?

Thanks in advance,
Ben

by the way, I'm using this:


Options +FollowSymlinks
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

Inigoesdr
01-24-2009, 07:29 PM
Just add a second condition to exclude your blog's URL:

Options +FollowSymlinks
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteCond %{REQUEST_URI} !^/blog
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

bencharity
01-26-2009, 06:05 PM
Awesome!! It worked perfectly!

Thanks so much!
Ben



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum