I am building a php+mysql site which will have numerous articles. I am pretty ok with html php jquery etc. I need to now what are the steps I need to take in order not have http://www.mysite.com/articles.php?id=123 but to have http://www.mysite.com/articles/123-title-of-article?
Thanks
I am building a php+mysql site which will have numerous articles. I am pretty
Share
Well, you need, for instance, to store the token for each article (to optimize), like your example “
123-title-of-article“. Next step is to use.htaccessandmod_rewritefrom Apache (if is your case).If you will do it only on this articles “page folder” (
articles/), I suggest to you make this folder valid and make the.htaccessinside that and redirect toarticles.php?id={POST_ID_FOUND_BY_TOKEN}.Take a look too on
$_SERVER["REQUEST_*"]variables from PHP.See: this page, on end of article have some examples.