如何为多个变量设置htaccess重写?
我最初为我的网站创建了 SEO 友好链接。我希望我的优惠券代码网站的链接看起来像这样:
http://www.mydomain.com/site/bodybuilding.com
所以我在有效的 htaccess 中进行了重写:
RewriteRule ^site/(.*)$ retailertest3.php?linklabel=$1
现在,我正在创建一个自定义联属计划。我希望用户能够将流量发送到以下链接:
http://www.mydomain.com/site/bodybuilding.com?ref=john
我将如何修改重写规则,以便 ref 变量正确传递到retailertest3.php?
另外,在我获取 ref 变量的值并用它做一些事情之后,是否可以进行 301 重定向回原始 URL:
http://www.mydomain.com/site/bodybuilding.com
我正在尝试避免可能出现的此类规范问题,并保留所有内容看起来很干净。
非常感谢任何帮助!!!!
非常感谢任何帮助!
I originally created SEO friendly links for my site. I wanted my links for my coupon code site to look like:
http://www.mydomain.com/site/bodybuilding.com
So I did a rewrite in the htaccess that worked:
RewriteRule ^site/(.*)$ retailertest3.php?linklabel=$1
Now, I'm working on creating a custom affiliate program. I want users to be able to send traffic to a link like:
http://www.mydomain.com/site/bodybuilding.com?ref=john
How would I go about modifying the rewriterule so that the ref variable is passed properly to retailertest3.php?
Also, after I get the value of the ref variable and do some stuff with it, is it possible to do a 301 redirect back to the original URL of:
http://www.mydomain.com/site/bodybuilding.com
I'm trying to avoid possible canonical issues like this, as well as keep everything looking clean.
Any help is greatly appreciated!!!!!
Any help is greatly appreciated!!!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这应该可以完成这项工作:
This should do the job: