【发布时间】:2014-08-19 10:15:28
【问题描述】:
我在尝试从 url 中删除 index.php 时遇到很大问题
我已经搜索了很多论坛(这也是),但对我的情况没有帮助。
所以我有 config.php 文件
$config['base_url'] = '';
$config['index_page'] = '';
$config['uri_protocol'] = 'AUTO';
我的 .htaccess 文件在 index.php 附近的 public_html 文件夹中
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /public_html/
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 /index.php
</IfModule>
在 WAMP apache(版本:2.4.9)中,我打开了 rewrite_module(并且它正在工作) 并且我的 httpd.conf AllowOverride 设置为 All
所以当我要去 mydomain.com/controller/action - 我得到 404 但是当我访问 mydomain.com/index.php/controller/action 时 - 一切正常..
我已经尝试了很多 .htaccess 示例......等等......没有任何帮助......
【问题讨论】:
标签: php apache .htaccess codeigniter url