|
目的:去掉URL中的"index.php"字符串
环境:windows XP
apache 2.2
-----------------------------
httpd.conf
DocumentRoot "E:/website"
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>
<Directory "E:/website">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<VirtualHost *:80>
ServerName www.mydomain.com
DocumentRoot E:/website/www
</VirtualHost>
LoadModule rewrite_module modules/mod_rewrite.so
-----------------------------
.htaccess
RewriteEngine on
RewriteCond $1 !^(index\.php|public|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]
http://www.mydomain.com/index.php/home显示正常
http://www.mydomain.com/home 返回404错误
把$config['index_page']置成空串还是不行,是否apache配置问题?
index.php和.htaccess存储在E:/website/www目录中。 |
|