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 4 of 4
  1. #1
    Regular Coder
    Join Date
    Aug 2004
    Location
    The Netherlands
    Posts
    211
    Thanks
    0
    Thanked 1 Time in 1 Post

    RewriteRule ^/$ redirects instead of masks the URI

    I've got a .htaccess file with a bunch of Rewrite rules for my website. It works perfectly except for the index page. Whenever you go to http://jero.net/ it redirects the URI to http://www.jero.net/archive/ (where my WordPress is installed). But when I go to http://jero.net/about/, it displays the content of http://jero.net/archives/about/ but the URI remains http://jero.net/about/, unlike http://jero.net/ does. Here is my .htaccess:

    Code:
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^www\.jero\.net$ [NC]
    RewriteRule ^(.*)$ http://jero.net/$1 [R=301,L] 
    
    RewriteRule ^index.html$ /archive
    RewriteRule ^(archives|projects|about|contact|portfolio|services)$ /archive/$1
    RewriteRule ^(archives|projects|about|contact|portfolio|services)/$ /archive/$1
    
    ErrorDocument 404 /archive/404/
    ErrorDocument 403 /archive/403/
    
    AddDefaultCharset utf-8
    Does anyone know how I can just mask the URI instead of redirecting (so that the URI remains http://jero.net/ instead of http://www.jero.net/archive/). Thanks in advance!
    Last edited by Jero; 04-15-2005 at 11:32 PM.

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I think it's the "L" at the end of the rule - if you remove that then it won't update the location
    "Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark

  • #3
    Regular Coder
    Join Date
    Aug 2004
    Location
    The Netherlands
    Posts
    211
    Thanks
    0
    Thanked 1 Time in 1 Post
    The first RewriteRule is to get rid of the www subdomain. I already tried my .htaccess without that, but it the URI http://jero.net/ was still changed to http://www.jero.net/archives/

  • #4
    Regular Coder
    Join Date
    Aug 2004
    Location
    The Netherlands
    Posts
    211
    Thanks
    0
    Thanked 1 Time in 1 Post
    Nevermind this topic. I got it fixed. It was all caused by WordPress' .htaccess...


  •  

    Posting Permissions

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