Configure Apache rewirte pseudo-static in vps (. htaccess is supported)

Source: Internet
Author: User
Tags vps

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.