重定向的引用者HTTP_REFERER的htaccess的基础上, [英] Redirect on the basis of referer HTTP_REFERER htaccess
本文介绍了重定向的引用者HTTP_REFERER的htaccess的基础上,的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经在这里我要重定向用户从referered网址,我怎么能做到,使用htaccess的?
I've an issue where i want to redirect a user on the basis of a substring from referered url, How i can accomplish that using htaccess?
- 用户是 http://example.com/aqeel/videos/
- 在有上述的网页。 http://demo.example.com/ 超链接
- 当用户达到 http://demo.example.com/ ,我希望他被重定向到的http://demo.example.com/login/aqeel/ ,这里阿基尔从引用者URL htaccess的捕获步骤1中的子网址。
- User is on http://example.com/aqeel/videos/
- There is a hyperlink on the above page http://demo.example.com/
- When user reaches http://demo.example.com/, I want him to be redirected to http://demo.example.com/login/aqeel/, Here aqeel is the substring captured from the referer url in htaccess from step 1 URL.
在此先感谢,
推荐答案
您可以使用下面code,使这项工作:
You can use below code to make that work:
RewriteCond %{HTTP_REFERER} http\:\/\/example.com/([a-z]+)/videos/
RewriteRule (.*)$ /login/%1/
我想对我的域名..和它的作品...希望太与您一起...:)
I tried on my domain.. and it works... hope that too work with you... :)
这篇关于重定向的引用者HTTP_REFERER的htaccess的基础上,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文