jason360 Posted March 3, 2015 Share Posted March 3, 2015 (edited) Hey guys, I am stumped on this htaccess write rule. I currently have this rule functioning: RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /item\.php\?pid=([a-z0-9]+)\ HTTP/ [NC] RewriteRule ^item\.php$ http://www.mysite.com/%1? [R=301,L] RewriteRule ^([-a-z0-9]+)$ /item.php?pid=$1 [NC,L] Original url: http://www.mysite.com/item.php?pid=2015-hyundai-genesis-coupe enabling this url: http://www.mysite.com/2015-hyundai-genesis-coupe What I require is a url like this: http://www.mysite.com/item/2015-hyundai-genesis-coupe I tried a bunch of things with no success. Anyone familiar with this? Thanks! Edited March 3, 2015 by jason360 Quote Link to comment https://forums.phpfreaks.com/topic/295036-htaccess/ Share on other sites More sharing options...
Stefany93 Posted March 3, 2015 Share Posted March 3, 2015 RewriteRule ^item/([-a-z0-9]+)$ /item.php?pid=$1 [NC,L] Try above. Quote Link to comment https://forums.phpfreaks.com/topic/295036-htaccess/#findComment-1507343 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.