Help - Search - Members - Calendar
Full Version: rewriting a url
Hostony Board > General Support > PHP/MySQL
MartinB
Well... i'm in blank today.

I want to rewrite the url: http://www.x.com/index.php?page=trekking

to: http://www.x.com/trekking.html

some mod_rewrite guru can tell me how is the sentense for rewrite this with apache mod_rewrite ?

thank you huh.gif
artrocity
not a guru but try this...

Options +Indexes
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^trekking.html$ index.php?page=trekking [L]
MartinB
thank you!!!!!!!

now i will try to figure how to do it dynamic, because trekking was only an example, but i have lot of pages with the same issue

some like "/index.php?page=X" = "/x.html" (or the inverse)

thanks for your help !!
artrocity
This might work for you then...

RewriteRule ^(.*).html$ index.php?page=$1 [L]
MartinB
QUOTE(artrocity @ Sep 4 2005, 05:00 PM)
This might work for you then...

RewriteRule ^(.*).html$ index.php?page=$1 [L]
*


Artrocity, Thank you very much smile.gif
have a nice day
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2024 Invision Power Services, Inc.
IPS Driver Error

IPS Driver Error

There appears to be an error with the database.
You can try to refresh the page by clicking here