【发布时间】:2021-03-30 14:19:35
【问题描述】:
我的网站生成的页面 URL 带有前缀 ?Script=,这对 SEO 不友好。
我想去掉这个前缀,只保留页面标题。
例如,我想转换以下网址:
example.com/?Script=about 到 example.com/about
about 是我网站的“关于”页面。
我想为所有页面设置一个忽略?Script= 的规则。
我已经通过使用以下重写规则为我的博客文章做到了这一点。
RewriteRule ^news/([0-9a-zA-Z_-]+) ?Script=news_view&uid=$1
【问题讨论】:
-
欢迎来到 SO,所以你的意思是你在浏览器中点击 url
example.com/?Script=about并且你想重定向(在浏览器中更改 URL)到example.com/about?请确认一次。 -
感谢您的关注。我网站的核心文件在其 URL 上附加了 &Script=。我想将此网址 example.com/?Script=about 重写为 example.com/about 这个网址,以便当我点击 example.com/about 它没有显示 404 错误。
标签: .htaccess mod-rewrite