从Google链接到网站的链接重定向到首页

时间:2018-08-23 10:50:08

标签: regex apache mod-rewrite hyperlink

我在服务器上的httpd-vhost文件中有一些重写规则,这些规则采用url并将/ content / site /替换为/ home /

RewriteRule   ^(.+)/$  /content/site/$1.html  [PT,L]

RewriteRule   ^/(\.resources/.*)$  e:/apps/Apache2.2.34/htdocs/$1  [L]

RewriteRule   ^/(home/.+)(\.html)?$  /content/site/$1.html  [PT,L]

RewriteRule   ^/(utilities/.+)(.html)?$  /content/site/$1.html  [PT,L]

问题是,如果链接是/content/site/examplepage.html,那么我从Google访问我的网站时,它将带我到我的主页而不是链接。如果我从Google复制链接并将其粘贴到URL中(仅当我单击链接时),则不会发生这种情况。

Google上的某些链接写为/home/examplepage.html,它们都可以正常工作。

感谢您的帮助

0 个答案:

没有答案
相关问题