Home  >  Article  >  Backend Development  >  How to Activate Mod_Rewrite in Different Operating Systems?

How to Activate Mod_Rewrite in Different Operating Systems?

Linda Hamilton
Linda HamiltonOriginal
2024-10-22 21:31:03424browse

How to Activate Mod_Rewrite in Different Operating Systems?

Mod_Rewrite Activation Across Operating Systems

Unlike PHP, mod_rewrite is an inherent component of Apache. To enable this module, locate either the httpd.conf or apache.conf file in your Apache configuration directory and ensure the following line is included:

LoadModule rewrite_module modules/mod_rewrite.so

To verify the module's activation, create an .htaccess file in a web directory with the following line:

RewriteEngine on

If this file parses without triggering a 500 internal server error, mod_rewrite is functioning properly and URL rewriting is enabled.

The above is the detailed content of How to Activate Mod_Rewrite in Different Operating Systems?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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