【发布时间】:2018-10-18 17:14:12
【问题描述】:
几周以来,我一直在努力解决这个问题。在 Google Search Console 中,我遇到了许多具有相同问题的抓取错误:Google 找不到甚至不存在的 url。
我查看了 html 代码,但相对 url 都很好。我对所有内部链接都使用了/-base。我认为问题在于我的 .htaccess 文件。
在我的网站 countriesleaguevoetbal.nl 上,我有两个带有不同重写的网址:
- /nieuws/项目
- /wedstrijd/id/土地
'land' 没有被使用,只是为了好看。现在谷歌搜索控制台找不到例如:
- /wedstrijd/id/nieuws/item
它在不应该的地方结合了两个 url。
我的 .htaccess 重写看起来像:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)$ /index.php?pagina=$1 [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^nieuws/([^/]+)$ /index.php?pagina=nieuws&item=$1 [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^wedstrijd/([^/]+)/([^/]+)$ /index.php pagina=wedstrijd&id=$1&landen=$2 [QSA,L]
我以为 QSA 会解决问题,但错误又回来了。你能帮帮我吗?
【问题讨论】:
-
我不确定您的问题是否有足够的信息来帮助您回答问题 - 您能否就当前的问题提供 minimal reproducible example?
标签: .htaccess url url-rewriting