Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Dec 2008
    Location
    Kennesaw, GA
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question .htaccess exception...

    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:

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

  • #2
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,638
    Thanks
    2
    Thanked 404 Times in 396 Posts
    Just add a second condition to exclude your blog's URL:
    Code:
    Options +FollowSymlinks
    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^www\.
    RewriteCond %{REQUEST_URI} !^/blog
    RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

  • #3
    New Coder
    Join Date
    Dec 2008
    Location
    Kennesaw, GA
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Awesome!! It worked perfectly!

    Thanks so much!
    Ben


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •