0

我有一个使用 codeigniter 制作的网站,它在本地机器上运行良好,但是当我将它上传到服务器时,它给了我一个 500 错误,当我删除 htaccess 时错误消失了,在本地机器上错误有时以不同的方式出现,我找不到导致此问题的原因,但某些 url 会像这样重写:原始 url => http://domain.com/controller/method 重写的 url => http://domain。 com/absolute/path/to/controller/method 这是我的 htaccess 文件:

RewriteEngine On
RewriteRule ^(welcome(/index)?|index(\.php)?)/?$ / [L,R=301]
RewriteRule ^(.*)/index/?$ $1 [L,R=301]
RewriteRule ^(.+)/$ $1 [L,R=301]
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

任何帮助,请提前谢谢。

4

1 回答 1

1

试试我的.htaccess代码............

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
于 2012-12-11T07:26:25.067 回答