Forum Moderators: coopster
Then you would want to clean the URL up to be something like
www.example.com/category/100/
www.example.com/category/My_Cat/
Assuming that you might have places to go other than categories, like articles or images or threads or posts or whatever.
If you don't, that is everything coming to your site is IDed by a category id, then you could do
www.example.com/100/
www.example.com/My_Cat/
This:
www.example.com/index/100
The /index part there really isn't necessary.
http://www.example.com/products.php Can be accessed as:
http://www.example.com/products Now, you can do nice URLs like:
http://www.example.com/products/category/product-name To access the items after products, parse $_SERVER['PATH_INFO']. I usually do this:
$Parts = explode("/",$_SERVER['PATH_INFO']); Then iterate through that array and use the the data. Also be warned that explode will assign $Parts[0] an empty value, since $_SERVER['PATH_INFO'] starts with a slash. A quick way around that is the replace the first slash with nothing:
$PathInfo = preg_replace("#^[/]#","",$_SERVER['PATH_INFO']); Then explode it.
Hope this helps!