I'm trying to redirect URLs with a half of MD5 part inside a PHP query and one base64 encoded string after a '#' symbol to a new directory using a .htaccess Rewrite Rule.
URL examples:
A) /?7027fcbbc2a1ccb9#N61/vMSRNqYQBhb+DcaSfv2YGW1HiBbSpMUoSHrtxok=
B) /index.php?f9c4bb60426abaf9#RBmcvFnf5+wFwP54IM8f7pUSvmPn2aOFm1Z6LbIOFK8=
The URL contains two parts:
- A half MD5 hash (16 a-f and 0-9 hash)
- Followed with one "#" then a base64 encoded string
I'm trying to ask if the URL containts the 16 alphanumeric chars, and if yes, I want to redirect the whole URL (including the #hash followed info) to a new directory.
I'm trying with this Rule:
RewriteRule ^\\?[a-f0-9]{16}$ /newdirectory/$1 [L]
But of course it doesn't work. What is the correct regex for the redirection? Thank you so much!
http://example.com/?7027fcbbc2a1ccb9#N61/vMSRNqYQBhb+DcaSfv2YGW1HiBbSpMUoSHrtxok=and i want redirect to:http://example.com/newdir/?7027fcbbc2a1ccb9#N61/vMSRNqYQBhb+DcaSfv2YGW1HiBbSpMUoSHrtxok=Regards!