zc309268032 发表于 2018-10-11 10:14:02

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

本帖最后由 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
</IfModule>


服务器重写也开启了,我域名直接定向到public这个目录的

Hex 发表于 2018-10-11 10:42:05

建议别用 apache。。。。。。

zc309268032 发表于 2018-10-11 12:01:40

Hex 发表于 2018-10-11 10:42
建议别用 apache。。。。。。

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

RewriteRule ^(.*)$ index.php?/$1 就能行。。。我也是无语

Hex 发表于 2018-10-11 14:03:32

zc309268032 发表于 2018-10-11 12:01
嗯,,我找了点资料解决了,,在apache下我是这样用的

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

现在各大互联网公司都用 nginx,没人用 apache 了。。。。

冰辉 发表于 2018-10-11 15:48:52

如果是IIS的话,安装url 重写模块;
然后增加规则就可以了;



页: [1]
查看完整版本: codeIgniter 4重写去掉index.php有问题