将/index.php?/bitcoin重定向到/ bitcoin - Codeigniter 301重定向问题

时间:2018-02-26 18:39:43

标签: php .htaccess codeigniter redirect http-status-code-301

我一直在努力解决一些htaccess重定向问题。我只是花了一些时间在堆栈上阅读和搜索,并且无法得到适用于我的场景的答案。

我正在将旧客户网站301重定向到新网站。

这是旧页面网址

https://digitalcoinprice.com/index.php?/first-bitcoin

https://digitalcoinprice.com/first-bitcoin

我有多个页要做,这里有几个例子:

index.php?/msd
index.php?/bitcoin
index.php?/ripple

所有这些都链接到不同的新页面。

这是我尝试的内容:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteCond %{THE_REQUEST} ^.*/index\.php
RewriteRule ^(.*)index.php$ /$1 [R=301,L] 

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]

我得到了正确的重定向,但是URL保存了这样的查询字符串:

https://digitalcoinprice.com/?/first-bitcoin

它没有工作(仍然有查询字符串)

谢谢!

0 个答案:

没有答案
相关问题