Jump to content

Dynamic ID not rewriting...


starboy

Recommended Posts

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)

Link to comment
https://forums.phpfreaks.com/topic/246236-dynamic-id-not-rewriting/
Share on other sites

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.