无法从 Codeigniter 3.0 URL 中删除 index.php
Unable to remove index.php from Codeigniter 3.0 URL
我无法从 CodeIgnitor 3.0 URL 中删除 index.php。我已经应用了很多解决方案,但没有任何效果。我正在使用 WAMP 2.5。 rewrite_module 在 Apache 中活跃。 $config['index_page'] = ''.我在根文件夹中的 htaccess 文件如下
RewriteEngine on
RewriteBase /Reporting/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond !^(index\.php|js|img|css|captcha|robots\.txt)
RewriteRule ^(.*)$ /yourfolder/index.php/ [L]
Reporting 是 www 中所有文件所在的文件夹。
在 .htaccess 中尝试使用此代码
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/ [L]
您在 Codeigniter 文档中有这个 - READ
我在使用 default .htaccess 代码删除 index.php 时遇到了问题,但我成功了,这就是我的 .htaccess 现在的样子。
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/ [L,QSA]
<Files "index.php">
AcceptPathInfo On
</Files>
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 /index.php
</IfModule>
我无法从 CodeIgnitor 3.0 URL 中删除 index.php。我已经应用了很多解决方案,但没有任何效果。我正在使用 WAMP 2.5。 rewrite_module 在 Apache 中活跃。 $config['index_page'] = ''.我在根文件夹中的 htaccess 文件如下
RewriteEngine on
RewriteBase /Reporting/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond !^(index\.php|js|img|css|captcha|robots\.txt)
RewriteRule ^(.*)$ /yourfolder/index.php/ [L]
Reporting 是 www 中所有文件所在的文件夹。
在 .htaccess 中尝试使用此代码
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/ [L]
您在 Codeigniter 文档中有这个 - READ
我在使用 default .htaccess 代码删除 index.php 时遇到了问题,但我成功了,这就是我的 .htaccess 现在的样子。
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/ [L,QSA]
<Files "index.php">
AcceptPathInfo On
</Files>
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 /index.php
</IfModule>