我使用easyphp重写url有些麻烦 . 这是我的环境配置:OS win7,Apache 2.4.2 . PHP 5.3.14 . httpd.conf文件
<Directory "${path}/www">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride All
#
# Controls who can get stuff from this server.
#
Require all granted
并且甚至从httpd.conf加载重写模块
..其他模块..
#LoadModule remoteip_module modules/mod_remoteip.so
#LoadModule request_module modules/mod_request.so
#LoadModule reqtimeout_module modules/mod_reqtimeout.so
LoadModule rewrite_module modules/mod_rewrite.so
#LoadModule sed_module modules/mod_sed.so
#LoadModule session_module modules/mod_session.so
#LoadModule session_cookie_module modules/mod_session_cookie.so
#LoadModule session_crypto_module modules/mod_session_crypto.so
#LoadModule session_dbd_module modules/mod_session_dbd.so
..其他模块..
从phpinfo开始,mod_rewrite也被加载了
Loaded Modules
core mod_win32 mpm_winnt http_core mod_so mod_access_compat
mod_actions mod_alias mod_allowmethods mod_asis mod_auth_basic
mod_authn_core mod_authn_file mod_authz_core mod_authz_groupfile
mod_authz_host mod_authz_user mod_autoindex mod_cgi mod_dir mod_env
mod_include mod_isapi mod_log_config mod_mime mod_negotiation
mod_rewrite mod_setenvif mod_php5
为了在主目录www中测试mod重写,我创建了文件page.html,并且我在home.html中重新创建它 . 我在www目录中的.htaccess规则是:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule "^index.html$" "page.html"
</IfModule>
没有任何附加内容,在我的浏览器网址中是http://127.0.0.1/page.html而不是http://127.0.0.1/index.html
你能帮助我吗?