Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does my page redirect to localhost in my wordpress blog?

This is my site URL http://www.weblogicsol.com/ , Here I installed a wordpress theme having URL http://www.weblogicsol.com/blog , the problem is this when I want to open the wp-admin (means when I write http://www.weblogicsol.com/blog/wp-admin) it redirect to localhost. Please help me to solve this problem, I am in trouble.

And if I write this code in wp-config file

define('WP_HOME','http://example.com'); define('WP_SITEURL','http://example.com');

then this URL appears with an error message.

http://weblogicsol.com/blog/wp-login.php?redirect_to=http%3A%2F%2Fwww.weblogicsol.com%2Fblog%2F%2Fwp-admin%2F&reauth=1

like image 492
Symfony Avatar asked Mar 19 '12 03:03

Symfony


People also ask

Why does my WordPress site redirect?

Links or pages redirecting to the home page is a common WordPress issue that is caused by many possible reasons, which include browser cache and cookies, permalinks, faulty plugins or themes, and changes to the . htaccess file.

How do I change redirect in WordPress?

Go to Tools > Redirection and scroll down to the Add new redirection section. In the Source URL field, type or paste in the URL you want to redirect from. In the Target URL field, type or paste in the URL you want to redirect to.


2 Answers

Check your wp-options table and find all occurrence of 'localhost' in option_value field

http://codex.wordpress.org/Database_Description#Table:_wp_options

SELECT * from wp_options where option_value like '%localhost%';

and change those to your live URL and you should be set

Here's a very extensive documentation on migrating wordpress http://codex.wordpress.org/Moving_WordPress

like image 148
Andreas Wong Avatar answered Sep 19 '22 05:09

Andreas Wong


Check the Dashboard -> Settings -> WordPress Address (URL), Site Address (URL) There should NOT be 'localhost'

like image 24
Alexey Tsinya Avatar answered Sep 18 '22 05:09

Alexey Tsinya