404 Page not found error in CentOS

Generally It will be an mod_rewrite issue. you could make sure following events

Config Apache mod_rewrite modules

1. open apache configuration location

#cd /etc/httpd/conf/httpd.conf

2. change  "AllowOverride None" to AllowOverride All inside the the document root directory
that is

<Directory "/var/www/html">

Permanently redirect users to access the site with or without the www. prefix

1. create or open a .htaccess file the document root folder and add the following text replacing variables with appropriate values were necessary.

#vi /var/www/html/.htaccess

#mod_rewrite
<IfModule mod_rewrite.c>
#enable mod_rewrite engine
RewriteEngine on

#following are not necessary
#with www
RewriteCond %{HTTP_HOST}^$uri\.$tld$ [NC]
  RewriteRule ^(.*)$ http://www(link is external).$domain$1 [L,R=301]

  # WITOUT 'www.'
  RewriteCond %{HTTP_HOST} ^www\.$uri\.$tld$ [NC]
  RewriteRule ^(.*)$ http://$domain/$1 [L,R=301]
</IfModule>

save that file

#service httpd restart

you will rid of 404 page not found error

Second possible error should allow deny port
kindly confirm either these lines been in the same file
127.0.0.1:80
0:0:0:0::80

Post a Comment

0 Comments