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

After I have installed LAMP on one web server ( 5.6 / 2) of , I found that although the module mod_rewrite is activated, the pages that had to comply with the rule of mod_rewrite they could not be accessed.

Not Found – The requested URL /rewrite_url.html was not found on this server.”

Activare mod_rewrite in Apache/2 (CentOS) Server.

1. After installation httpd (Apache), we open the file /etc/httpd/conf/ with an editor (nano /etc/httpd/conf/httpd.conf) and we check first and foremost if the module “mod_rewrite.so” It is found in DSO (Dynamic Shared Object). We should find the line “LoadModule rewrite_module modules/mod_rewrite.so” without character “#” in front. If this character exists you will have to be deleted, and if the line is missing will have to be added.

loadmodule_mod_rewrite

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

allowoverwrite

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

4. Restart httpd

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

Now everything should go OK. Remember to add to the root folder of the site file .htaccess with the lines:

RewriteEngine On
Rewritebase /

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

Founder and editor Stealth Settings, din 2006 pana in prezent. Experienta pe sistemele de operare Linux (in special CentOS), Mac OS X , Windows XP > Windows 10 si WordPress (CMS).

Home Your source of IT tutorials, useful tips and news. Enable & Setup mod_rewrite in Apache/2.2.3 (CentOS) Server (httpd.conf settings)
Leave a Comment