Home RewriteRule for Gmail Email Addresses
Reply: 0

RewriteRule for Gmail Email Addresses

user984
1#
user984 Published in July 21, 2018, 1:49 pm

I'm trying to create a rewrite rule for unsubscribe URLs so that the url

https://example.com/unsubscribe/myemail@example.com/

will be re-written to

https://example.com/unsubscribe.php?email=myemail@example.com

In the past I've always used the following rule with no problems

ReWriteRule ^unsubscribe/(.*)/?$ /unsubscribe.php?email=$1 [NC,L]

However, when testing this recently, it seems to be replacing the "+" character (as is used commonly with gmail tagging, for example "myemail+spam@example.com") with an empty space, creating an email address different to the one entered by the user. This is a problem. You can see an example here:

Example Rewrite Rule Processing

I don't really get why this is happening as the "(.*)" filter should allow any character any number of times, shouldn't it?

Any suggestions would be greatly appreciated.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.316852 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO