.htaccess rewrite rule for email / token

坚强是说给别人听的谎言 提交于 2019-12-23 19:26:21

问题


I can't make this work, any ideas?

.htaccess code:

Options +FollowSymlinks
Options -MultiViews
RewriteEngine On
RewriteRule ^unsubscribe/([^/]*)/(.*)/&$ unsubscribe.php?hash=$1&email=$2

I'm trying to transform this URL:

unsubscribe.php?hash=dbacb2d010eb022619e90c8df2654aab273&email=enriquealbiola@iqs.edu

To this one:

unsubscribe/dbacb2d010eb022619e90c8df2654aab273/enriquealbiola@iqs.edu

I've really tried searching, and the code I have is what I got, but it isn't working...

Thanks!


回答1:


Replace this line :

RewriteRule ^unsubscribe/([^/]*)/(.*)/&$ unsubscribe.php?hash=$1&email=$2

By this one :

RewriteRule ^unsubscribe/([^/]*)/(.*)/?$ /unsubscribe.php?hash=$1&email=$2 [L]


来源:https://stackoverflow.com/questions/12144297/htaccess-rewrite-rule-for-email-token

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!