如何删除一个?使用 301 重定向从带有 htaccess 的 url
我需要一个 htaccess 301 重定向来从这个 url:
http://www.example.com/index.php/?content/page1
到
http://www.example.com/content/page1
我当前的 htaccess 规则是:
RewriteBase /
RewriteCond %{HTTP_HOST} !=""
RewriteRule ^index.php(/.*)$ http://%{HTTP_HOST}$1 [R=301]
问题是我得到这样的 url:
http://www.example.com/?content/page1
如何从 url 中删除问号 (?)。这也适用于该模式中的大约 20 个不同的 url。我希望该规则适用于我所有在此模式中需要为 301 的 url。
I need an htaccess 301 redirect for dynamic urls going from this url:
http://www.example.com/index.php/?content/page1
to
http://www.example.com/content/page1
My current htaccess rule is:
RewriteBase /
RewriteCond %{HTTP_HOST} !=""
RewriteRule ^index.php(/.*)$ http://%{HTTP_HOST}$1 [R=301]
the problem is I get urls like this:
http://www.example.com/?content/page1
How can I remove that question mark (?) from the url. Also this is for about 20 different urls in this pattern. I would like the rule to work for all my urls needing to be 301 in this pattern.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
以
?
结束目标。End the target in a
?
.