Local instance of WordPress showing page not found 404 error

When working with local instance of wordpress, once in a while you would face this situation that home page works as usual but when click on other pages or post, it shows a 404 error that page not found, this is a common problem when working with group of people on one project, one gets it right and other gets an error, this is because of mis configuration of server and missing .htaccess file, it could be because of both errors or one of them will give the same 404 error Create .htaccessfile with an dot beginning of file name, and it doesn’t have to be any extension at the end of file name, paste these contents in the file and save them

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wordpress-installation-directory/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress-installation-directory/index.php [L]
</IfModule>
# END WordPress

Then open the httpd.conf from apache and search for the string rewrite until you find this code

#LoadModule rewrite_module modules/mod_rewrite.so

Remove the # symbol from line then save it and restart the server, then the problem should be solved

Vivek Vengala
 

Vivek Vengala is a Online Entrepreneur, Web Developer from Hyderabad India.

Click Here to Leave a Comment Below 0 comments

Leave a Reply:

x

Join My Facebook Group to Receive Coding Tutorial for Free

email-subsribe