My redirect rules keep redirecting. Please help.

Discussion in 'Apache' started by shadow_boi, Jul 17, 2010.

  1. #1
    Hi guys,
    I have a dynamic page say: www.mysite.com/index?lookup=faqs

    I want use a static url like: www.mysite.com/yourfaqs to visit that page. And once people enter the dynamic url, it should be directed to the static url.

    That is, the URL shown on the address bar on the browser, should always be the static url.

    I have the following rules:

    RewriteRule ^yourfaqs /index.php?lookup=faqs [L]

    RewriteCond %{QUERY_STRING} lookup=faqs
    RewriteRule ^index\.php$ http://www.mysite.com/yourfaqs/$1? [R=301,L]

    But as might see the problem here, it keeps redirecting.
    Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

    Is there a way to do what i want?
    Thanks in advance.
     
    shadow_boi, Jul 17, 2010 IP
  2. shadow_boi

    shadow_boi Peon

    Messages:
    374
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    shadow_boi, Jul 17, 2010 IP
  3. SamPeterson

    SamPeterson Peon

    Messages:
    13
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    RewriteRule ^([A-Z0-9-]+) index.php?lookup=$1 [NC,L]

    or
    RewriteRule ^faq index.php?lookup=faq [NC,L]
     
    SamPeterson, Jul 17, 2010 IP
  4. shadow_boi

    shadow_boi Peon

    Messages:
    374
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    shadow_boi, Jul 17, 2010 IP
  5. shadow_boi

    shadow_boi Peon

    Messages:
    374
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Actually, 2 of my rules from the original post above work fine individually.

    However, when I use them together, it keeps redirecting.

    Looking for a solution to fix that issue.

    Thanks again.
     
    shadow_boi, Jul 17, 2010 IP