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

How to enable url rewriting in apache

王林
Release: 2020-06-22 17:00:22
forward
3385 people have browsed it

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
Copy after login

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!

Related labels:
source:jb51.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template