【发布时间】:2012-11-19 09:09:34
【问题描述】:
我创建的 htaccess 没有正常运行,为什么?
这是我的 htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
#RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
php_value memory_limit "64M"
</IfModule>
和索引页面配置
$config['index_page'] = '';
但是还是找不到404页面
http://hostname/blog <=== 404 page not found
http://hostname/index.php/blog <=== normal page show up
【问题讨论】:
-
重写规则行前面有一个“#”注释标记。为什么?
-
删除 # 或尝试 RewriteRule ^(.*)$ index.php?$1 [L]
-
把那个正斜杠从那里拿出来^ index.php?/$1 = index.php?$1
标签: php .htaccess codeigniter config