I’m trying to develop site on php and mysql, at this moment i’m 50% done with php coding, though I don’t know almost anything about php programming :). Now I’m stuck in url structure for my site.
My sites root directory is localhost/mysite and when I going to a article page I have
localhost/mysite/article.php?title=any-article-title
I want to change this slug in to
localhost/mysite/article/any-article-title
I saw an exact similar thread here but I cant implement that answer to my site.
Any help will be highly appreciated
One more thing I would like to add – Is there any global rule to do the same for all files like article.php?title= or product.php?item= or category.php?id=
The possible problem that you may be facing here is the way how you accessing to your site:
localhost/mysite/...This can make perfectly valid rewrite rule not to work (based on other configuration parameters/circumstances). It will be better if you could set up your website to be accessible via dedicated domain name (which you can easily fake viahostsfile) — so that you can access your local website viahttp://mysite.dev/index.phpinstead of the currenthttp://localhost/mysite.com/index.php.Anyway — these are the rules:
You can do the rest (
product.php?item=orcategory.php?id=) in a similar fashion.