Mod Rewrite with Apache

Discussion in 'Apache' started by trochta, Jul 23, 2007.

  1. #1
    My website serves pages as this:

    http://www.executivebiotech.com/view.php?job_id=220 with the text link: Hazardous Material Chemist

    I want it to show the link text rather than the above link.

    So, it would display /Hazardous-Material-Chemist-220.html


    Any clues as to how to do this?
     
    trochta, Jul 23, 2007 IP
  2. KalvinB

    KalvinB Peon

    Messages:
    2,787
    Likes Received:
    78
    Best Answers:
    0
    Trophy Points:
    0
    #2
    KalvinB, Jul 23, 2007 IP
  3. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #3
    Options +FollowSymLinks +Indexes
    RewriteEngine on
    RewriteBase /
    RewriteRule ^([^.]+)\-([^.]+)\.html$ view.php?job_id=$2 [L]
     
    Nintendo, Jul 23, 2007 IP
  4. VimF

    VimF Well-Known Member

    Messages:
    307
    Likes Received:
    27
    Best Answers:
    0
    Trophy Points:
    118
    #4
    That can't be done with mod_rewrite alone.

    You'll need to use PHP/MySQL.
     
    VimF, Jul 24, 2007 IP