2012-12-11 141 views
0

我有一个我用codeigniter制作的网站,它在本地机器上工作的相对较好,但是当我将它上传到服务器时,它给了我一个500错误,错误是当我删除htaccess时,并在本地机器错误出现在不同的方式有时我找不到是什么原因造成这个,但一些网址得到这样的重写: 原始网址=>http://domain.com/controller/method 重写的url =>http://domain.com/absolute/path/to/controller/method 这里是我的htaccess文件:codeigniter htaccess重写URL到BASEPATH ../

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] 

任何帮助,感谢名单提前。

+0

你已经装载mod_rewrite的服务器上?你的错误日志说什么? –

+0

已经修复。 –

回答

1

尝试用我的.htaccess代码........

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

thanx,那工作。 –

+0

upvote有可能 –

+0

对不起,我只在12声望不能upvote,直到我达到15。 –