嗨,我是codeigniter的新手,并使用它作为我的网址
http://localhost/codeigniter/index.php/site
并包括以下htaccess文件
RewriteEngine On
RewriteBase/codeigniter
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [PT,L]
将此 htAccess filr 包含到代码点火器文件夹后,网页在两者上都停止工作
http://localhost/codeigniter/index.php/site
和
http://localhost/codeigniter
基本上我需要
http://localhost/codeigniter
上班
请帮忙
谢谢
RewriteBase 和基本 URI 之间缺少空格:
RewriteBase /codeigniter
这可能就是事情停止工作的原因(服务器错误状态 500,您可以在错误日志中找到)。
使用这个,
RewriteEngine on
RewriteCond $1 !^(index'.php|images|robots'.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
欲了解更多详情,请单击此处。
为了使代码点火器站点默认为站点控制器,您需要更新配置/路由.php将站点控制器设置为默认路由。
有关重写问题,请参阅@Repox的答案。