2011-03-01 74 views
5

我有一个问题,我想重定向用户的基础上从参考url的子字符串,我怎么可以使用htaccess完成?基于referer HTTP_REFERER重定向htaccess htaccess

  1. 用户是http://example.com/aqeel/videos/
  2. http://demo.example.com/
  3. 当用户达到http://demo.example.com/,我希望他被重定向到http://demo.example.com/login/aqeel/上述网页中的超链接,这里阿基尔是以下形式URL中捕获的子串步骤1 URL中的htaccess。

由于事先

回答

5

您可以使用下面的代码,使这项工作:

RewriteCond %{HTTP_REFERER} http\:\/\/example.com/([a-z]+)/videos/ 
RewriteRule (.*)$ /login/%1/ 

我想在我的领域..它的作品...希望太与您合作... :)