Redirect on the basis of referer HTTP_REFERER 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?
- User is on http://example.com/aqeel/videos/
- There is a hyperlink on the above page http://demo.开发者_JAVA技巧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.
Thanks in Advance,
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... :)
精彩评论