Install the mod_rewrite module

Source: Internet
Author: User
Install the mod_rewrite module-Linux Enterprise Application-Linux server application information. For more information, see. However, most servers install and enable this module by default, but there are some exceptions.

Is the module loaded?
Sometimes the module is compiled into an httpd binary stream. If so, you can run the following command to check whether the module is loaded.

Httpd-l

If the list does not exist, it may be dynamically loaded. In this case, you can view the following code output:



If you compile and install Apache 4 by yourself, you only need to add the following lines to your configuration file (note: this will automatically load the module when Apache starts)

./Configure? Enable-module = rewrite

If you are using a branch version of Apache, such as Fedora Core (Red Hat Linux Server version), you must install the relevant devel tool.

Yum install apache2-devel

In this way, the mod_rewrite module can be used.

Now mod_rewrite is loaded, but it cannot work
This is typical, meaning that the default Apache configuration does not allow the use of the client. htaccess file. You need to change

AllowOverride None
Is
AllowOverride All

You only need to open and edit the httpd. conf file and search for AllowOverride to modify it. This is the first configuration that affects root directory properties, but it is not what you want.



This is the second Web root directory attribute configuration. You can modify this attribute, but you may not want all your websites to allow mod_rewrite module operations (such as write operations ). Of course, you can create another directory node for a specific site,



Options FollowSymLinks
AllowOverride All
Related Article

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.