Forum Moderators: phranque

Message Too Old, No Replies

mod rewrite - dynamic url problems

         

Daithi123

1:53 pm on Oct 19, 2006 (gmt 0)

10+ Year Member



Hi,
I am sure this is a simple one, but I cannot seem to fix it.

I have tested that mod_rewrite is working with a simple script:

RewriteEngine on
RewriteRule ^alice.html$ bob.html

This works fine, but I want to generate SEO friendly links from my database driven page. I have the classic master/detail page set:
locationa <Link to locationdetail.php?id=1>
locationb <Link to locationdetail.php?id=2>
locationc <Link to locationdetail.php?id=3>

When the user clicks on the link (e.g. locationb), they are taken to the details page with the relevent id (e.g. www.mysite.com/locationdetail.php?id=2)
However, I want this to show up as www.mysite.com/locationb.php
I have tried a number of scripts from different sites on the web, but haven't had any success. Could anyone please help me?
Thanks in Advance guys!

jdMorgan

3:28 pm on Oct 19, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



See the thread Changing Dynamic URLs to Static URLs [webmasterworld.com] in our Apache Forum Library [webmasterworld.com] to get started.

Jim