...

View Full Version : lose extension, keep query



jmace
12-18-2010, 06:56 PM
On my website, I am using redirects to change addresses like
http://example.com/about to
http://example.com/?page=about

I have this code:


RewriteEngine on
RewriteRule ^([a-zA-Z0-9]+)$ ./?page=$1

Which works great. Until you have an address like this:
http//example.com/about?name=bob

The query is completely lost. How can I do the redirect and keep the query? So
http://example.com/about?name=bob becomes
http://example.com/?page=about&name=bob

Thanks.

Inigoesdr
12-18-2010, 09:24 PM
RewriteEngine on
RewriteRule ^([a-zA-Z0-9]+)$ ./?page=$1 [L,QSA]

jmace
12-19-2010, 07:05 AM
. . . I feel like a moron now that I know the solution was so simple, lol.

But thank you very much for the help!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum