hi i need to rewrite following url usin php or htacces file mysite.com/browse.html?level=50&categoryname=mobilephones as mysite.com/mobilephones.html is there any possible answers?
Don't you also need the level to display? If you do you will want to rewrite it to something like mysite.com/mobilephones_lvl50.html which you would do by adding this to your .htaccess RewriteRule ^(.*)-lvl([0-9]+).html$ browse.html?categoryname=$1&level=$2 If you don't need the level and you want to re-write to mysite.com/mobilephones.html you would simply put: RewriteRule ^(.*).html$ browse.html?categoryname=$1
Or in the format mysite.com/50/mobilephones.html Alternatively if `mobilephones` is unique, you can just structure it mysite.com/mobilephones.html http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html
Here it goes RewriteEngine On RewriteRule ^([^/]*)\.html$ /browse.html?level=50&categoryname=$1 [L] Code (markup):
Thanxs for your reply Above level mean category id is there anyway to send category id without display in page url "mobilephones_lvl50.html"
Thanks for all of your helps Finaly I wrote follow "RewriteRule ^level/([^/]*)/([^/]*)\.html$ /browse.html?level=$1&categoryname=$2 [L]" Result is http://mysite.com/level/50/mobilephones.html Problem is css is not loading how can i solve that?
put '/' in front of the path of your css file. it make the path become absolute, not relative to the current page.
assign an $mainurl = 'http://mysite.com/theme/style.css'; then include where ever u wanna css this is really easy
Hi Above all of replies work fine thanks lot !!! i want to mask white space when rewriting url. for a example if subcategory name ='Mobile Phones' its should be rewrite as mobile-phones.html is it possible? FYI Currently iam using following method to rewrite "RewriteRule ^level/([^/]*)/([^/]*)\.html$ /browse.html?level=$1&categoryname=$2 [L]"