0

我们有这样的链接,用户可以在电子邮件中点击这些链接。

https://www.samplesite.com/re/Jim.Smith

发生的事情是他们被重定向到绝对 url 而不是上面的个性化 url。

因此,在单击电子邮件中的链接后的 url 中,它看起来像这样。

https://www.samplesite.com/sample_folder/landing.aspx?rid=Jim.Smith

我们希望保持 url 链接与电子邮件中的链接相同。以下是我们的螺旋规则。你能告诉我如果这有什么问题吗?

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]
4

1 回答 1

0

您需要重写,而不是重定向。改变这个:

[NC,L,R]

对此:

[NC,L,U]

告诉它重定向,这R就是你正在经历的。删除R遗嘱只是重写。

(我喜欢包括U解开 IIS 日志 url 的方法,因此日志显示原始 url。这取决于你。)

作为旁注,由于您的规则是检查 /re/... 您不需要包含 robots.txt 和 favicon.ico 的行

于 2015-02-07T02:19:54.747 回答