Mod_rewrite

I am attempting to create an .htaccess file that will change the url. Currently the url is http://localhost/floral/index.php?pg=about. I want it to read http://localhost/floral/about when on this page. This is for my local server but would like it to work on a host server also.

There are 5 pages and I want them to display without the index.php?pg= showing. As of yet I haven’t been able to figure re-writes out.

Thanks

Got it figured out and forgot I had posted her. Thanks for you reply dklynn.

464,

Aw, come on now! Apache can’t guess the format you want to see in your links so it’s YOUR job to CREATE the links the way that you want them viewed THEN to create the mod_rewrite statement to fetch the correct file.

I don’t normally “code for free” (I loathe “script kiddies”) but this is SO SIMPLE:

RewriteEngine on
RewriteRule ^floral/([a-z]+)$ floral/index.php?pg=about [L]

I encourage you NOT to use this code until you understand what it’s doing, i.e., view the tutorial linked in my signature. It’ll lead you through developing correct regex and provides a fistful of coding examples from years of experience with member questions.

Regards,

DK