Note that there are some explanatory texts on larger screens.

plurals
  1. POConverting parameter based URL's to pretty URL's
    primarykey
    data
    text
    <p>Currently I have url's in this format:</p> <p><a href="http://www.domain.com/members/username/" rel="nofollow">http://www.domain.com/members/username/</a></p> <p>This is fine.</p> <p>However each user may have several 'songs' associated with their account.</p> <p>The url's for the individual song's look like this:</p> <p><a href="http://www.domain.com/members/username/song/?songid=2" rel="nofollow">http://www.domain.com/members/username/song/?songid=2</a></p> <p>With the number at the end obviously referring to the ID in the MySQL database.</p> <p>Using jQuery/javascript, the ID is collected from the URL and the database is then queried and the relevent song/page is rendered.</p> <p>I would like to change these URL's to the following format instead:</p> <p><a href="http://www.domain.com/members/username/song/songname/" rel="nofollow">http://www.domain.com/members/username/song/songname/</a></p> <p>But I have absolutely no idea how to go about it. I've been doing quite a bit of reading on the subject but haven't found anything quite relevant to my situation.</p> <p>To further compound the challenge, song names are not always unique. For instance if we image the song name 'hello' it is quite possible that another song may exist in the database with the same name, albeit with a different song ID.</p> <p>Given the limit information you are recieving in this question I am quite content with more generalised answers, describing the approach to take.</p> <p>General info:</p> <ul> <li>Apache/Nginx proxy</li> <li>Backend: PHP</li> <li>jQuery/Javascript front end</li> </ul>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload