用户
 找回密码
 入住 CI 中国社区
搜索
查看: 1781|回复: 4
收起左侧

[URL] codeIgniter 4重写去掉index.php有问题

[复制链接]
发表于 2018-10-11 10:14:02 | 显示全部楼层 |阅读模式
本帖最后由 zc309268032 于 2018-10-11 10:17 编辑

C:\Users\Administrator\Desktop\a.jpg
该开启的也可开启了,也按文档这样配置了,还是没有反应啊

<IfModule mod_rewrite.c>       
        RewriteEngine On
        RewriteBase /       
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteCond $1 !^(index.php|images|robots\.txt)
        RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>


服务器重写也开启了,我域名直接定向到public这个目录的
发表于 2018-10-11 10:42:05 | 显示全部楼层
建议别用 apache。。。。。。
 楼主| 发表于 2018-10-11 12:01:40 | 显示全部楼层
Hex 发表于 2018-10-11 10:42
建议别用 apache。。。。。。

嗯,,我找了点资料解决了,,在apache下我是这样用的

RewriteRule ^(.*)$ index.php?/$1 [L]  就能行。。。我也是无语
发表于 2018-10-11 14:03:32 | 显示全部楼层
zc309268032 发表于 2018-10-11 12:01
嗯,,我找了点资料解决了,,在apache下我是这样用的

RewriteRule ^(.*)$ index.php?/$1 [L]  就能行。 ...

现在各大互联网公司都用 nginx,没人用 apache 了。。。。
发表于 2018-10-11 15:48:52 | 显示全部楼层
如果是IIS的话,安装url 重写模块;
然后增加规则就可以了;
TIM图片20181011154801.png


本版积分规则