Home >Backend Development >PHP Tutorial >How to Enable mod_rewrite Independently of Operating System?
The mod_rewrite module is a critical component of Apache for manipulating URLs. Contrary to popular belief, its activation process is not tied to a specific operating system.
To enable mod_rewrite, locate the httpd.conf file within your Apache configuration directory. Within this file, search for the following line and ensure it is uncommented:
LoadModule rewrite_module modules/mod_rewrite.so
Once activated, you can test whether URL rewriting is functioning correctly by placing a .htaccess file in a web directory. Include the following line within the .htaccess file:
RewriteEngine on
If the .htaccess file is successfully parsed without generating a 500 internal server error, then mod_rewrite is properly configured and ready for use.
The above is the detailed content of How to Enable mod_rewrite Independently of Operating System?. For more information, please follow other related articles on the PHP Chinese website!