Hi I want to make my urls seo friendly but don't know how to use the htaccess file for that. I have some urls: 1- www.mysite.com/list.php?category=xyz Change to: www.mysite.com/xyz and 2- www.mysite.com/details.php?product=productname Change to: www.mysite.com/xyz/productname Code (markup): how to make this urls with htaccess file?
RewriteEngine On RewriteRule ^(.*)$ list.php?category=$1 RewriteRule ^(.*)/(.*)$ list.php?product=$2 I used (.*) because it will accept any data...Thats so you can have spaces and stuff in the name or numbers too...Hit me up if you need help.
Thanks, but it doesn't work properly when I use this code other pages don't work properly and they can't read the css file in root of my site. any idea for it?
Here you go, this should help a bit: RewriteEngine On RewriteRule ^l-(.*)$ list.php?category=$1 RewriteRule ^l-(.*)/p-(.*)$ list.php?product=$2 l = list p = product There, no more issues should be seen if you follow that standard.
Thanks another question: I have the same problem for another site. mysite.com/layouts.php?keyword=abstract I want to change this url to: mysite.com/abstract.html any idea about this?
well...if you pm me, we can talk about how to do that...Message me on any client you have or pm me here with another option.