1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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:
    970
    Likes Received:
    678
    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