Forum Moderators: phranque

Message Too Old, No Replies

Multiple special strings ($,?) in rewrite rules

Advanced redirect urls -- getting it work

         

quickhelpneeded

9:31 pm on Mar 31, 2011 (gmt 0)

10+ Year Member



Does anyone have luck redirecting this kind of URLs via htaccess rewrite rules?

mydomain.com/&id=AGiWqtweNmw6VMAPye9wiBKx0tgKFevOBg&link=http://subdomain.domain.com/9999/x?dc_uid=3&dx_udd=realname&dz_ydd=1234&da_xdd=a&xd_asd=c&ax_tgx=&az_pln=&url=http//www.mydestination.com?id=1&_$me=unique:0987

basically i have url have multiple special signs.

RewriteCond %{QUERY_STRING} ^dc_uid=3&dx_udd=realname&dz_ydd=1234&da_xdd=a&xd_asd=c&ax_tgx=&az_pln=&url=http//www.mydestination.com?id=1&_$me=unique:0987$
RewriteRule &id=AGiWqtweNmw6VMAPye9wiBKx0tgKFevOBg&link=http://subdomain.domain.com/9999/x DESTINATION

didnt really work for me.

g1smd

9:34 pm on Mar 31, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



It would not work.

The RewriteCond correctly looks at QUERY_STRING.

The pattern that the RewriteRule sees can match ONLY the path part of the URL. It cannot see the query string data.

Use ^(index\.php)?$ to match both index.php and no filename at all.

quickhelpneeded

9:45 pm on Mar 31, 2011 (gmt 0)

10+ Year Member



could you elaborate a little more?
Please note there are two query strings in the whole url, that could be a problem too?

g1smd

10:08 pm on Mar 31, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



That could also be an issue.

The main problem is that RewriteRule matches only the path part of a URL. It cannot match the query string you have put there.