Home >Operation and Maintenance >Apache >How to enable url rewriting in apache

How to enable url rewriting in apache

王林
王林forward
2020-06-22 17:00:223398browse

How to enable url rewriting in apache

URL rewriting in Apache 2.x is implemented through mod_rewrite.so, so you need to check whether Apache has been compiled into this module, and in the Apache configuration file httpd This module has been called in .conf.

(Recommended tutorial: apache from entry to proficiency)

How to enable url rewriting in apache under Linux:

1. Open httpd in apache .conf (usually in the /etc/httpd/conf directory)

2. Find #LoadModule rewrite_module modules/mod_rewrite.so and remove the previous

#3. Find AllowOverride None and change it to AllowOverride All, change all two

Note: The AllowOverride parameter is set to ALL, which means that the entire server supports URL rule rewriting.

The Apache server needs to read the .htaccess file in the directory of each website. If there is no such file, or if this document does not define any rules about URL rewriting, it will have no effect.

4. Restart apache

service httpd restart

The above is the detailed content of How to enable url rewriting in apache. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:jb51.net. If there is any infringement, please contact admin@php.cn delete