This article introduces how to configure Apache rewirte pseudo-static (supports. htaccess) in Linux vps. I hope this tutorial will be helpful to you.
Linux rewirte pseudo-static
1. Modify apache % C5 % E4 % D6 % C3/"target =" _ blank "> apache configuration to enable the rewrite module.
The Code is as follows: |
Copy code |
1. cd/etc/httpd/conf/ 2. vi httpd. conf
|
3. Find LoadModule rewrite_module modules/mod_rewrite.so.
4. If there is no or "#" in front of it, add the corresponding line or cancel the comment #
Second, modify the AllowOverride attribute.
The Code is as follows: |
Copy code |
<Directory/> Options FollowSymLinks Change AllowOverride None to All </Directory> |
Restart apache. Go to your WORDPRESS background to update the fixed link. The. htaccess file is automatically generated in the root directory.
Load the Rewrite module in windows:
Find httpd. conf In the conf directory
The Code is as follows: |
Copy code |
LoadModule rewrite_module modules/mod_rewrite.so
|
Remove the comment symbol "#" from the front or add this sentence.
You can use the ". htaccess" file in any directory and change "AllowOverride" to "All" ("None" by default "):
The Code is as follows: |
Copy code |
# 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
|
In Windows, the ". htaccess" file cannot be created directly. You can use "echo a>. htaccess" on the command line to create the file, and then use NotePad to edit it.
TIPS: The rewirte pseudo-static enabling will be mentioned here. If you still don't understand it, you can search for it on this site.