外部链接的固定链接
我想在我的网站上使用永久链接作为外部链接。例如,如果我的网站上有此链接:google.com
,它应该重写为[并向读者显示]:
mysite.com/go/google
这可能吗?关于如何在 .htaccess 中执行此操作有什么想法吗?
I would like to use permalink for external links on my site. For example, if I have this link on my site: google.com
, it should rewrite to [and show the reader]:
mysite.com/go/google
Is this possible? Any ideas on how to go about doing this in .htaccess?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您无法重写外部网址。重写不会查看您的 html 代码,它会查看发送到 Apache 的请求,并根据您的重写规则提取内容。
You can't rewrite external urls. Rewriting doesn't look at your html code, it looks at the request sent to Apache, and pulls content based on your rewrite rule.