让apache 支持伪静态

打开apache配置文件httpd.conf

1.把 LoadModule rewrite_module modules/mod_rewrite.so前面的#去掉

2.把 AllowOverride None 改成  AllowOverride FileInfo Options

有两个地方要改:

<Directory />
Options FollowSymLinks
AllowOverride FileInfo Options
Order deny,allow
Deny from all
</Directory>

#
# Note that from this point forward you must specifically allow
# particular features to be enabled – so if something’s not working as
# you might expect, make sure that you have specifically enabled it
# below.
#

#
# This should be changed to whatever you set DocumentRoot to.
#下面路径是你的网站更目录路径
<Directory “D:/shanmaoweb/shanmao/mylocalhost”>
#
# 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.2/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 FileInfo Options

#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all

</Directory>