Note that there are some explanatory texts on larger screens.

plurals
  1. POMake URL's look good dynamically
    text
    copied!<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/4301481/how-do-i-convert-a-php-query-string-into-a-slash-based-url">How do I convert a PHP query string into a slash-based URL?</a> </p> </blockquote> <p>If I have database driven pages with urls like this:</p> <pre><code>http://www.companyname.com/dynamic_page.php?id=1 http://www.companyname.com/dynamic_page.php?id=2 http://www.companyname.com/dynamic_page.php?id=3 ... http://www.companyname.com/dynamic_page.php?id=4001 http://www.companyname.com/dynamic_page.php?id=4002 http://www.companyname.com/dynamic_page.php?id=4003 </code></pre> <p>Where the id in the url is used to get the correct content from the database, and the user has the ability to add/remove/edit as many pages as s/he wants.</p> <p>I understand how to manually use mod_rewrite to give the urls a nicer look e.g.</p> <pre><code>http://www.companyname.com/individual/1 http://www.companyname.com/individual/2 http://www.companyname.com/individual/3 ... http://www.companyname.com/commercial/4001 http://www.companyname.com/commercial/4002 http://www.companyname.com/commercial/4003 </code></pre> <p>But how would I do that dynamically? i.e. allow the user to specify part of the url, in this case the user has selected either "individual" or "commercial", then add the id at the end of the url, without me having to edit the .htaccess file each and everytime a user makes a new page, or edits/deletes a page.</p>
 

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