URL Rewritting works perfect in FF but not in IE 6

Discussion in 'Apache' started by Kellerkind, Mar 10, 2007.

  1. #1
    Hi,
    I have the following htaccess code to rewrite nice urls to urls with variables to use for a script:

    
    Options +Indexes
    Options +FollowSymlinks
    RewriteEngine On
    RewriteBase /
    
    RewriteRule  ^tags/(.*)$ ?c=$1 [L]
    
    PHP:
    Everything works fine in FF but not in IE 6. My goal is to have http://mysite.com/tags/category1 rewritten on the server to http://mysite.com/c=category1 that I can catch it as a variable.

    I tried something else and it works perfect in both browsers but it also displays the http://mysite.com/c=category1 in the browser which i want to avoid. This is the code that made it work:


    
    RewriteCond %{HTTP_HOST} ^mysite.com$
    RewriteRule ^tags\/(.*) http://mysite.com/?c=$1  [QSA,L,R=301]
    
    PHP:

    Is there any way to get this working in FF and IE that the browser still shows http://mysite.com/tags/category1?
    Any help would be AWESOME!... I spent the last 8 hours reading mod rewrite tutorials and trying all sorts of stuff so it would be cool if any pro could help me out.
     
    Kellerkind, Mar 10, 2007 IP
  2. andre75

    andre75 Peon

    Messages:
    1,203
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Remove R=301 and you should be fine.
     
    andre75, Mar 10, 2007 IP
  3. Kellerkind

    Kellerkind Active Member

    Messages:
    160
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #3
    didn't help... i don't get it. it does work sometimes if i refresh the page several times. any other ideas what might be wrong with the variables or whatever?
     
    Kellerkind, Mar 12, 2007 IP
  4. andre75

    andre75 Peon

    Messages:
    1,203
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I can tell you after I checked my own .htaccess tonight.
    Try this:
    RewriteRule ^tags\/(.*)$ http://mysite.com/?c=$1 [QSA,L]

    (I added a $ and removed the 301)

    Also I think the RewriteCond is somewhat redundant, since it will always apply.
     
    andre75, Mar 12, 2007 IP