Help with 3 lines in mod rewrite

Discussion in 'Apache' started by testblanc, Dec 14, 2007.

  1. #1
    Hi,

    I need to do redirect some page using .htaccess (mod rewritting).
    I tried without success.

    Page name -------------------------- Dynamic page

    artist-letter to artiste.php?id=letter
    artist/thename to artiste.php?name=thename
    artist/radio/thename to index.php?artist=thename

    Thanks!

    With artist-letter, it is something like artist-a, artist-b, artist-3, artist-5
     
    testblanc, Dec 14, 2007 IP
  2. Jean-Luc

    Jean-Luc Peon

    Messages:
    601
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Bonjour,

    Try this:
    Options +FollowSymlinks
    RewriteEngine on 
    
    RewriteRule ^artist\-\w+$ /artiste.php?id=$1  [L]
    
    Code (markup):
    This will replace:
    - /artist-a by /artiste.php?id=a
    - /artist-xyz123 by /artiste.php?id=xyz123

    Jean-Luc
     
    Jean-Luc, Dec 14, 2007 IP