开发者

Redirect request from specific domain

开发者 https://www.devze.com 2023-02-05 05:25 出处:网络
Hey guys, Ex: - root doma开发者_Go百科in - domain.com A link on example.net leads to domain.com Could that request be redirected to domain.com/redirect/ and allow requests from other domain names to

Hey guys, Ex: - root doma开发者_Go百科in - domain.com A link on example.net leads to domain.com

Could that request be redirected to domain.com/redirect/ and allow requests from other domain names to access domain.com with no redirection?

Thank you for your time and help!


I don't have an apache server with a suitable setup to test it right now, but mod_rewrite should be able to do it with something like this:

RewriteCond %{REQUEST_URI} /
RewriteCond %{HTTP_REFERER} example.net
RewriteRule ^(.*)$ http://domain.com/redirect [R=301]
0

精彩评论

暂无评论...
验证码 换一张
取 消