starboy Posted September 2, 2011 Share Posted September 2, 2011 So I have a bunch of unique pages I'm populating with _GET from the value in my url (noob stuff) But after doing numerous amounts of research I CAN NOT get it to rewrite the URL.. Example url localhost/detail.php?id=20 I want the above to be.. localhost/detail/20 this is what I have currently in my .htaccess RewriteEngine On RewriteRule ^details/([0-9]+)/?$ detail.php?id=$1 [NC,L] # Handle detail requests (ps. I thought maybe I didn't have Apache configured correctly by I can redirect index.php to anything) Quote Link to comment https://forums.phpfreaks.com/topic/246236-dynamic-id-not-rewriting/ Share on other sites More sharing options...
starboy Posted September 2, 2011 Author Share Posted September 2, 2011 RewriteRule ^events/([0-9]+)/?$ detail.php?id=$1 [NC,L] Quote Link to comment https://forums.phpfreaks.com/topic/246236-dynamic-id-not-rewriting/#findComment-1264599 Share on other sites More sharing options...
cags Posted September 2, 2011 Share Posted September 2, 2011 What URL are you requesting, your rewrite looks correct assuming you type yourdomain.com/details/10 (or enquiries if your second post was supposed to indicate that was a typo in your first) in your browsers address bar you should get served yourdomain.com/details?id=10 Quote Link to comment https://forums.phpfreaks.com/topic/246236-dynamic-id-not-rewriting/#findComment-1264636 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.