18

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

MMM
  • 7,221
  • 2
  • 24
  • 42
Symfony
  • 2,289
  • 6
  • 23
  • 30

5 Answers5

34

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

Andreas Wong
  • 59,630
  • 19
  • 106
  • 123
  • Very Very thanks Mr. Andreas, I am very glade after solving my problem – Symfony Mar 19 '12 at 03:45
  • Glad it helps, please take your time to click on the check button on the left hand side of my answer :) http://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work – Andreas Wong Mar 19 '12 at 03:46
  • This is a very good point... At a glance we only see the first 2 records. But using the query we find 4 records. And the 4th one has multiple occurences of the path. So it's best to change it manually or via a text editor. – itsols Aug 08 '16 at 14:07
3

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

Alexey Tsinya
  • 391
  • 3
  • 4
1

Here is the way. 1. Login to Phpmyadmin 2. select Db 3. goto table "wp_options" 4. change url in siteurl & home.

its works 100%

jain raj
  • 11
  • 4
0

There are two areas in the WP_OPTIONS that you need to change. One is one the fisrt page and the other one is on the 2nd page.

This video will definitely help if you have access to phpMyAdmin

http://educhalk.org/blog/?p=21

  • @YoavVollansky Were you able to sort it out? –  Jan 11 '19 at 15:04
  • Sorry, I might not remember what I did exactly. I think I used phpmyadmin to replace all the strings of the old URL with the new one. Hope this helps. @Shaz M – Yoav Vollansky Jan 16 '19 at 04:51
0

you should check wp_options on your database , modify site url dan home as your web domain