8

I Upload Wordpress Website From Server to Localhost When I Open http://localhost/wordpress/wp-admin it redirect to me http://localhost/dashboard/

  • Did you change site URL and home URL ? – Sumit Apr 23 '16 at 15:33
  • When I test/debug a wordpress site locally, I set the site url in my host file to access the site with the same url. (down side is that you can't access the real site while you have this record in your host file) – Rabin Apr 24 '16 at 8:28
  • Yes i change site url and home url... – Abdul Ali Khan Apr 25 '16 at 5:07
11

It sounds like the site & home URLs are not set correctly.

You can set these in wp-admin from the Settings screen, although it sounds like you may not be able to get in there right now, so a workaround is to do the following:

  1. Edit your wp-config.php file
  2. Search to see if WP_HOME or WP_SITEURL is present in this file
  3. If they are, change the address listed to 'http://localhost/wordpress/'

If WP_HOME and WP_SITEURL aren't present in your wp-config.php file yet, add the following code to the file (anywhere before the comment that says 'that's all, stop editing'):

define('WP_HOME', 'http://localhost/wordpress/');
define('WP_SITEURL', 'http://localhost/wordpress/');

If this is the correct address you've installed at, and everything has been moved across correctly, you should then be taken to your login screen when you visit http://localhost/wordpress/wp-admin.

EDIT:

If it's still not redirecting, let's check your .htaccess file. I'm fairly sure this shouldn't be impacting the log-in to wp-admin, but we should correct it nevertheless. Open .htaccess and look for the Wordpress section similar to the below, and add wordpress/ where you see it below on the RewriteBase and RewriteRule lines:

# BEGIN WordPress

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

# END WordPress

Updating the .htaccess file is another step that needs to be taken when you move a site, but in most cases it will only affect your Permalinks and is taken care of just by clicking Save on the Settings -> Permalink page in wp-admin. Hopefully updating it manually now might help you too...

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.