Step by step to fix this issue
1. Wp-config file
- Edit your
wp-config.php
file - Search to see if
WP_HOME
orWP_SITEURL
is present in this file - If they are, change the address listed to
'http://localhost/wordpress/'
If
WP_HOME
andWP_SITEURL
aren't present in yourwp-config.php
file yet, add the following code to the file
define('WP_HOME', 'http://localhost/wordpress/');
define('WP_SITEURL', 'http://localhost/wordpress/');
2. Check .htaccess file
Open .htaccess and look for the Wordpress section similar to the below, and add your-site-name/ where you see it below on the RewriteBase and RewriteRule lines:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /your-site-name/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
</IfModule>
# END WordPress
3. Open wp-admin of your local website
1. After login on site, navigate onto Settings -> Permalink page change the website URL with your local website URL.
4. Add www in the doamin url in domain settting
- Edit your
wp-config.php
file - Search to see if
WP_HOME
orWP_SITEURL
is present in this file - If they are, change the address listed to
'http://www.localhost/wordpress/'
If
WP_HOME
andWP_SITEURL
aren't present in yourwp-config.php
file yet, add the following code to the file
define('WP_HOME', 'http://www.localhost/wordpress/');
define('WP_SITEURL', 'http://www.localhost/wordpress/');
These setups definately solves the issues, if you are still facing this issue , please let me know by sending me mail.