We have links like this that users click on in emails.
https://www.samplesite.com/re/Jim.Smith
What is happening is they are getting redirected to the absolute url instead of the personalized url above.
So in the url after clicking on the link in the email it looks like this.
https://www.samplesite.com/sample_folder/landing.aspx?rid=Jim.Smith
We wish to keep the url link the same as the link in the email. The following is our helicon rule. Can you tell me what if anything is wrong with this?
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_Host} (^(?:www\.)?www.samplesite.com$) [NC]
RewriteCond %{REQUEST_URI} !^/(robots\.txt|favicon\.ico)$ [NC]
RewriteRule ^/re/([^/]+)$ https://www.samplesite.com/sample_folder/landing.aspx?rid=$1 [NC,L,R]
You need a rewrite, instead of a redirect. Change this:
[NC,L,R]
to this:
[NC,L,U]
The R
is telling it to redirect, which is what you're experiencing. Removing the R
will just do a rewrite.
(I like to include U
which means to unmangle the url for the IIS logs, so the logs show the original url. This is up to you.)
As a side note, since your rule is checking for /re/... you don't need the line with the robots.txt and favicon.ico
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.