I am not a PHP developer at heart and I have been asked to perform some SEO on an existing PHP website.
The first thing I noticed was the ugly URLs so I want to get these to rewrite to something more informative. Here are all the possible patterns:
/index.php?m=ModuleType&categoryID=id
/index.php?m=ModuleType&categoryID=id&productID=id
/index.php?page=PageType
/index.php?page=PageType&detail=yes
So basically what I want to do is convert these into something like:
/ModuleType/Category
/ModuleType/Category/ProductName
/Page
/Page
I haven’t used mod_rewrite before any advice or examples would be great!
Thanks.
mod_rewrite would rather be used to do the opposite: rewrite requests of
/ModuleType/Category/ProductNameinternally to/index.php?m=ModuleType&categoryID=id&productID=id. Using the new URLs in the documents is the job of your application.Edit Here’s an example of how a function might look like that turns your parameterized URLs into the new ones: