Edit url structre using .htaccess

Discussion in 'General Programming Chat' started by mylikes786, Mar 7, 2016.

  1. mylikes786

    mylikes786 Registered Member

    Joined:
    Oct 31, 2013
    Messages:
    81
    Likes Received:
    6
  2. MrBlue

    MrBlue Senior Member

    Joined:
    Dec 18, 2009
    Messages:
    975
    Likes Received:
    682
    Occupation:
    Web/Bot Developer
    Something similar to this should get you going. Please note I've not tested it.
    Code:
    RewriteEngine On
    RewriteCond %{THE_REQUEST} /dir.php\?song=([^\s]+) [NC]
    RewriteRule ^ /song/%1? [NC,L,R]
    RewriteRule ^song/([^/.]+)/?$ /dir.php?song=$1 [NC,L]
    
     
    Last edited: Mar 10, 2016