Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WordPress localhost site redirect to live site

I have download the code and export the database from server and setup the site on my localhost also I have been changed the home and site URL in wp_options table I am able to login at wp-admin but when I am clicking on the home page it redirect me to live site.

If anyone know the issue please help me.

Thanks in Advance.

like image 367
Israr Mansuri Avatar asked Apr 18 '17 05:04

Israr Mansuri


3 Answers

You need to replace database URL and directory path while downloading database from 1 provider to other. In your case, I suspect that you have downloaded database directly, without changing URL and directory path.

You need to re-download database. You can simply use "WP Migrate DB" plugin for this. You can find it here

Let me know if you need further assistance...

like image 195
WildProgrammers Avatar answered Nov 16 '22 09:11

WildProgrammers


open your wp-config.php file and add this

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

then save the file from admin set the permalinks defaults and resave it with %postname%

if not work recreate your htaccess file

Hope it will work for you

Thanks

like image 29
R.K.Bhardwaj Avatar answered Nov 16 '22 11:11

R.K.Bhardwaj


I had this issue too. I changed the permalink type and reset MAMP. Before resetting MAMP, I changed the web server type from Nginx to Apache in MAMP.

like image 1
Sohrab Avatar answered Nov 16 '22 09:11

Sohrab