Enable & Setup mod_rewrite in Apache / 2.2.3 (CentOS) Server (httpd.conf settings)

After I installed LAMP on a web server ( 5.6 / 2) of We found that although the module mod_rewrite is enabled, pages must comply with the mod_rewrite could not be accessed.

"Not Found - The requested URL /rewrite_url.html was not found on this server. "

Enable mod_rewrite in Apache / 2 (CentOS) Server.

1. After installing the httpd (Apache), open the file / Etc / httpd / conf / with an editor (nano / etc / httpd / conf / httpd.conf) and we check first of all if the module “mod_rewrite.so”Is found in DSO (Dynamic Shared Object). We should find the line "Rewrite_module LoadModule modules / mod_rewrite.so"Without character"#" in front of. If this character exists it will have to be deleted, and if the line is missing it will have to be added.


2. We leave open the editor and search httpd.conf (Ctrl+ W for search in nano) the line on which the directive is “AllowOverride None". Here we will have to change from "AllowOverride None"In"AllowOverride All".


3. Ctrl+X and Y to save changes made to the file httpd.conf.

4. Httpd restart

service httpd restart or /etc/init.d/httpd restart

Now everything should work OK. Do not forget to add in the site root folder file .htaccess lines:

RewriteEngine On
RewriteBase /

Enable & Setup mod_rewrite in Apache / 2.2.3 (CentOS) Server.

Founder and editor Stealth Settings, from 2006 to the present. Experience on operating systems Linux (in particular CentOS), Mac OS X, Windows XP> Windows 10 si WordPress (CMS).

How to » Linux » Apache » Enable & Setup mod_rewrite in Apache / 2.2.3 (CentOS) Server (httpd.conf settings)
Leave a Comment