简体   繁体   English

没有在配置中更改index.php的Codeigniter和.htaccess无法正常工作

[英]Codeigniter without index.php changing in config and .htaccess not working

I have this issue with codeigniter for my subdomain where I would like to take out index.php but is not working for some reason. 我的子域Codeigniter出现此问题,我想删除index.php,但由于某些原因无法正常工作。

I have set .htaccess with below: 我在下面设置了.htaccess:

RewriteEngine on
RewriteCond $1 !^(index\.php|images|captcha|css|js|user_guide|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]

and also config.php index_page settings have been changed like below: 以及config.php index_page设置也进行了如下更改:

$config['index_page'] = '';

do you know why it's not working? 您知道为什么它不起作用吗?

And this is mine 这是我的

DirectoryIndex index.php
RewriteEngine on

RewriteCond $1 !^(index\.php|(.*)\.swf|forums|images|css|downloads|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php?$1 [L,QSA] 

This is how mine is currently setup, hope this helps. 这是我当前的设置方式,希望对您有所帮助。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM