First, make sure that the conf/httpd. conf file in the Apache installation directory is Enabled:
# Code 1 # loadmodule rewrite_module modules/mod_rewrite.so
Then you need to specify the Directory and configuration for implementing the rewrite function in the httpd. conf file, as shown below:
# Code 2 # <directory "D: \ www \ BC"> # specify the directory where you want to execute the following rewrite rules # possible values for the options directive are "NONE ", "All", # or any combination: # 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 all # the original value here is -- none by default, # controls who can get stuff from this server. # order allow, deny allow from all </directory>
This section introduces the configuration code above # Code 2 # the previous section:
DocumentRoot "D: \ www "# specify the root directory of APACHE service # Each directory to which Apache has access can be configured with respect # to which services and features are allowed and/or disabled in that # directory (and its subdirectories ). # first, we configure the "default" to be a very restrictive set of # features. # <directory/> # specify permissions for the Apache service root directory: AllowOverride | order deny, allow # deny from all options followsymlinks AllowOverride none order deny, allow deny from all </directory>
This article is from the "I am very dish" blog. I will not repost it!
Apache rewrite module configuration enabling code Introduction