SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Apache upgrade broke rewrite

  1. #1
    SitePoint Enthusiast
    Join Date
    Mar 2003
    Posts
    94
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Apache upgrade broke rewrite

    I upgraded from apache 1.x to 2.x

    Now the rewriterule isn't working as it should;

    Code:
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST} ^www.website\.com [NC]
    RewriteRule (.*) http://website.com/$1 [R=301,L]
    
    RewriteRule ^(us|uk)/$ http://website.com/index.php?loc=$1 [L]
    The redirect from www to http works fine. But the website.com/uk/ seems to just redirect to http://website.com/index.php?loc=uk and not stay as website.com/uk/ in the url bar.

  2. #2
    SitePoint Zealot
    Join Date
    Aug 2008
    Posts
    123
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    "RewriteRule ^(us|uk)/$ http://website.com/index.php?loc=$1 [L]" - try keep relative path in this rule

    "RewriteRule ^(us|uk)/$ index.php?loc=$1 [L]"

  3. #3
    SitePoint Enthusiast
    Join Date
    Mar 2003
    Posts
    94
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ahh right, that fixed it. Thanks

Bookmarks

Posting Permissions

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