Trying to rewrite URLS getting endless loop, the rewrite code looks fine?, going nuts

Discussion in 'Apache' started by donttrustthisposter, Aug 13, 2008.

  1. #1
    Hey all,

    I need to make a what should be simple rewrite urls from

    Productname-123456.html

    to

    Productname-p-123456.html

    So for an oscommerce store to switch to ultimate SEO urls format.

    Here's what should work but isn't

    
    RewriteRule ^(.*)-([0-9][0-9][0-9][0-9][0-9][0-9])\.html$ $1-p-$2.html [R=301,L]
    
    Code (markup):
    The probllem is right after the $2

    If I put another character there ie

    
    RewriteRule ^(.*)-([0-9][0-9][0-9][0-9][0-9][0-9])\.html$ $1-p-$2e.html [R=301,L]
    
    Code (markup):
    Notice the "e"

    Now it works but I would now have an "e" there.

    Please how should I pursue this? Am I supposed to wrap the $2 in something?

    Thanks
     
    donttrustthisposter, Aug 13, 2008 IP
  2. donttrustthisposter

    donttrustthisposter Peon

    Messages:
    1,477
    Likes Received:
    91
    Best Answers:
    0
    Trophy Points:
    0
    #2
    nobody? Really need some input.
     
    donttrustthisposter, Aug 15, 2008 IP