CodeIgniter URL重写不起作用

CodeIgniter URL重写不起作用,codeigniter,Codeigniter,我正试图用www.hostname.com/crm/some/url将CodeIgniter框架中的url重定向到www.hostname.com/index.php?/some/url 我在我的.htaccess中写了以下规则 RewriteEngine on RewriteRule ^crm(.*)$ index.php?/$1 [L] 当我在浏览器中尝试这一点时,我从codeIngnitor获得了页面未找到404。但是如果在重定向规则中添加[R]标志,它将正常工作,并且我可以在更

我正试图用www.hostname.com/crm/some/url将CodeIgniter框架中的url重定向到www.hostname.com/index.php?/some/url

我在我的.htaccess中写了以下规则

RewriteEngine on
RewriteRule ^crm(.*)$ index.php?/$1     [L]
当我在浏览器中尝试这一点时,我从codeIngnitor获得了页面未找到404。但是如果在重定向规则中添加[R]标志,它将正常工作,并且我可以在更改后看到预期的新url


我尝试了apache重写日志。一切看起来都很正常。我没有什么URL的CodeIgniter框架看到重写后。非常感谢您的帮助。

您不使用典型的Codeigniter.htaccess有什么原因吗

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
您可以按照此操作,将此代码复制并粘贴到.htaccess文件中。我想 它会帮助你的


你这样做有什么特别的原因吗?当前的URL很整洁,而新的则不那么整洁。。
RewriteEngine on
RewriteCond $1 !^(index\.php|(.*)\.swf|forums|images|css|uploads|themes|downloads|jquery|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php?$1 [L,QSA]