1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

RewriteRule .htaccess help!

Discussion in 'Site & Server Administration' started by tlshaheen, Aug 1, 2010.

  1. #1
    The following code is in my .htaccess, and currently works - the first two lines are for if a user goes to example.com/Pancake, example.com/Pan-cake, example.com/pan-cake, or example.com/pancake, it takes them all to example.com/Pan-cake/index.php.

    The last line is for if a user goes to example.com/pancake/whatever.php, it redirects it to example.com/Pan-cake/whatever.php.
    The problem is if I try to add the line
    RewriteRule ^Pan\-cake(.*) http://www.example.com/Pan-cake$1 [NC,L]
    Code (markup):
    I get an error "Firefox has detected that the server is redirecting the request for this address in a way that will never complete."

    What line should I write so that example.com/pan-cake/whatever.php redirects to example.com/Pan-cake/whatever.php?

    RewriteRule ^Pan\-cake$ http://www.example.com/Pan-cake/index.php?ref=stype [NC,L]
    RewriteRule ^Pancake$ http://www.example.com/Pan-cake/index.php?ref=stype-nd [NC,L]
    RewriteRule ^Pancake(.*) http://www.example.com/Pan-cake$1 [NC,L]
    
    Code (markup):

     
    tlshaheen, Aug 1, 2010 IP
  2. tlshaheen

    tlshaheen Peon

    Messages:
    89
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Got the answer from another place! Make the p lowercase, and removed NC from the line in question. Having NC, and a upper case P, was indeed the problem.
     
    tlshaheen, Aug 1, 2010 IP
    mcfox likes this.