Forum Moderators: phranque

Message Too Old, No Replies

Rewrite dynamic url that starts with?

ewrite dynamic url that starts with "?" final answer

         

greenone

9:40 am on Mar 14, 2007 (gmt 0)

10+ Year Member



Hello,

I hope someone can help me with what I'm trying to do:

I have urls like this:

[domain.com...]

I'm trying to rewrite them using the word hotel/ plus the id number:

[domain.com...]

Is this the right code to do that?

Options +FollowSymlinks
RewriteEngine On
RewriteRule ^hotel/([0-9]+)/?action=HotelPlanListPC&hid=$1&%{QUERY_STRING} [L]

NOTE: There is a space before "?action" but this board keeps eating it.

Would someone help me or tell me if this is the right direction?

Thanks,

jdMorgan

3:38 pm on Mar 14, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'd suggest:

Options +FollowSymlinks
RewriteEngine On
RewriteRule ^hotel/([0-9]+)/$ /?action=HotelPlanListPC&hid=$1 [QSA,L]

Jim