.htaccess redirect question (reg. ex.)

Discussion in 'Site & Server Administration' started by falcondriver, Aug 19, 2006.

  1. #1
    falcondriver, Aug 19, 2006 IP
  2. Shadow

    Shadow Peon

    Messages:
    191
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
  3. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #3
    Options +Indexes
    Options +FollowSymlinks
    RewriteEngine on
    RewriteBase /
    RewriteRule ^classic/([^.]+)\.asp$ http://www.domain.com/$1.php [R=301,L]
     
    Nintendo, Aug 19, 2006 IP
    falcondriver likes this.
  4. falcondriver

    falcondriver Well-Known Member

    Messages:
    963
    Likes Received:
    47
    Best Answers:
    0
    Trophy Points:
    145
    #4
    great, it works now.
    but i still dont understand why it is "$1.php". shouldt it be something like "newpage.php?$1" because i need my parameters "$1" AFTER the ".php"?
    i assume $1 are the first parameters here as defined by regex, or am i on a wrong track here?
     
    falcondriver, Aug 19, 2006 IP
  5. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #5
    Where's the URL change in...

    .asp?id=254

    and

    .php?id=254

    It's .php and asp. You don't need it at the number spot if the numbers stay the name.
     
    Nintendo, Aug 21, 2006 IP
  6. falcondriver

    falcondriver Well-Known Member

    Messages:
    963
    Likes Received:
    47
    Best Answers:
    0
    Trophy Points:
    145
    #6
    ah ok.
    guess i should find a good book about this topic next time im in a bookstore.
     
    falcondriver, Aug 21, 2006 IP