Forum Moderators: phranque

Message Too Old, No Replies

Rule Malfunction

         

khuram

8:43 pm on Jan 18, 2010 (gmt 0)

10+ Year Member



Hi,

I have this rule in the htaccess.

RewriteRule ^reg/complete/([a-zA-Z0-9%\.\-_]+)/([a-zA-Z0-9%\.\-_]+)/([a-zA-Z0-9%\.\-_]+)/?$ register-complete.php?username=$1&unique_code=$2&salt=$3 [QSA,L]

However, the URLs such as this

http://example.com/reg/complete/yahoo.com/02efba1ac126ef5d1bb8d0757ed291d3/ed1d3c2ecf1944ac05352cc0f14c4a85

become http://example.com/register-complete.php?username=yahoo.com&unique_code=02efba1ac126ef5d1bb8d0757ed291d3&salt=ed1d3c2ecf1944ac05352cc0f14c4a85&phpMyAdmin=16f69a99a2198b770f990220d7927552

Which means that that the rule is identifying the pattern but its redirecting to it real unwanted url.

Can you kindly help out.

Also, I am not sure about this part ([a-zA-Z0-9%\.\-_]+)

I want to be able to allow only dash, underscore and a dot in the URLs. Is it possible and is my rule right because I use this atom in many other places as well.

Kind Regards,

jdMorgan

8:52 pm on Jan 18, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It seems that your query parameters are hexadecimal numbers, that that "%" character is spurious, and that uppercase letters need not be matched. Therefore "[0-9a-f._\-]" would seem more appropriate.

If i'm reading this correctly, the basic problem seems to be that 'something' --and not this rule itself-- is appending the "&phpMyAdmin=16f69a99a2198b770f990220d7927552" query parameter. So I'll ask, is this internal rewrite rule followed by any external redirect rules -- perhaps in a lower-level .htaccess file?

Jim

khuram

9:32 am on Jan 19, 2010 (gmt 0)

10+ Year Member



Hi Jim

The &php part is due to a bad html forming by the client but I do not think that is the problem.

but shouldnt "[0-9a-f._\-]" be more appropriately "[0-9a-zA-Z._\-]"

Please advice,

Kind Regards,

g1smd

10:14 am on Jan 19, 2010 (gmt 0)

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



Be aware that the 'a-zA-Z' matching can be speeded up by using 'a-z' with the [NC] flag.

khuram

10:35 am on Jan 19, 2010 (gmt 0)

10+ Year Member



Hi G1smd,

but what about "a-f" as jim mentioned.

khuram

11:24 am on Jan 23, 2010 (gmt 0)

10+ Year Member



Errr anything new here :)

jdMorgan

11:03 pm on Jan 23, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



No. If you have a question not previously answered, go ahead and ask it...

It seems that your query parameters are hexadecimal numbers, that that "%" character is spurious, and that uppercase letters need not be matched. Therefore "[0-9a-f._\-]" would seem more appropriate.

Jim