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 2 of 2
  1. #1
    New Coder
    Join Date
    Aug 2007
    Location
    Philippines
    Posts
    26
    Thanks
    9
    Thanked 0 Times in 0 Posts

    htaccess 301 redirect everything except /admin

    I have been scratching my head for almost half an hour already because of this. I don't know what I am doing wrong, might just be under my nose, but i just cant see it. Here's what I have on my
    Code:
    .htaccess
    Code:
      RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
      RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
    
      RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
      RewriteCond %{REQUEST_URI} !^/admin [NC]
      RewriteRule ^(.*)$ http://newsite.com/$1 [R=301,L]
    When I access
    Code:
    example.com/admin
    i am still redirected to
    Code:
    newsite.com/admin
    Can anyone please advise? Thanks!

    I also tried this How to do 301 redirect with exceptions but to no avail

  • #2
    New Coder
    Join Date
    Aug 2007
    Location
    Philippines
    Posts
    26
    Thanks
    9
    Thanked 0 Times in 0 Posts
    anyone?


  •  

    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
    •