How to make SEO friendly url in PHP?
|
05-22-2014, 07:34 AM
Post: #1
|
|||
|
|||
How to make SEO friendly url in PHP?
Hello Everyone.
We wanted to know about how to make seo friendly url. Currently my website has oshopindia.com/products.php?catid=15. We want to change it to oshopindia.com/products/mobile-phones. We tried Mod Rewrite but it doesnot work. Is there any alternate way? Please let me know the same. Manthan Thakkar Oshopindia Ads |
|||
05-22-2014, 07:42 AM
Post: #2
|
|||
|
|||
Yes There are number of ways to promote your website. Go on this site http://www.elance.com . both sites are best for you. In less amount you can hire expert person to promote your website
Ads |
|||
05-22-2014, 07:48 AM
Post: #3
|
|||
|
|||
You haven't shown how you used Mod Rewrite so it's not possible to say why it didn't work. But probably because your mod rewrite does not deliver the "15" which your system needs to know what the category is.
It should read: RewriteRule /products/(.*)-(.*)\.php$ products.php?catid=$2 and then the URL would be: oshopindia.com/products/mobilephones-15 This passes the "15" which the shopping cart needs to call the correct category. However if you don't want the "15" to show then you will need a coding solution. Create a database with 'clean URLs' in it and then in your modrewrite is as follows: RewriteRule /products/(.*)\.php$ products.php?cat_url=$1 Use GET to pick up the cat_url variable and then look up in the database the corresponding catid and then execute the rest of the code. |
|||
05-22-2014, 08:01 AM
Post: #4
|
|||
|
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)