我也遇到了同样的问题,我几乎已经尝试了.htaccess 的所有在线代码
我的Xamp运行在Linux上,仅供参考-应用程序在intranet上,而不是在internet上,这可能会导致一些问题。
我已检查mod_rewrite是否已启用。当我运行php.info()函数时,它显示了加载不足的模块。
在我的配置文件中
$config['base_url'] = '';
$config['index_page'] = '';
$config['uri_protocol' = 'AUTO';
我的工作url是artery,它是根目录中的一个子目录http://whintranet.wh.tvh.ca/arteri/index.php/artery/home但是当我从中删除index.php时
在此服务器上找不到请求的URL/arthry/artery/home。Apache/2.2.15(CentOS)服务器,位于whintranet.wh.tvh.ca端口80
my.htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /arteri/
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
任何帮助都非常感谢
将您的基本url设置为包含此答案中所述协议的绝对路径不要忘记尾部斜线
$config['base_url'] = 'http://whintranet.wh.tvh.ca/arteri/';
$config['index_page'] = '';
$config['uri_protocol' = 'AUTO';
根据这个答案设置你的htaccess
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /arteri/index.php?/$1 [L]