allkin
By:
allkin

Connecting from IP working but domain has problems on Wordpress(Ubuntu 14.04)

October 22, 2014 1.6k views

Hello,
I just joined digitalocean and created a virtual host with wordpress(used the one click install). I followed the tutorial and now when i try to access the site, the domain works but all internal links point to IP.
My DO looks like this: http://i.imgur.com/iEs7qZ9.png
The test site link is : southparkromania[dot]com
If I need to give any more info, tell me :).

2 comments
  • The links point to your domain name for me. Have you managed to fix it? If not, try clearing your browser's cache or using another browser.

  • I checked with browserstack and the page loads normaly now, but I encountered another problem.
    In google webmaster when I test a link, I get a redirect warning: http://imgur.com/gNVxiR7

1 Answer

This will be a database issue.

You'll need to modify the database for your site, and find all columns in wpoptions that are set to 'http://YOURIP' and change them to 'http://YOUR_DOMAIN'

something like this (this is merely an example -- DO NOT COPY/PASTE THIS):

UPDATE wp_options SET option_value='http://domain.com' WHERE option_value='http://1.2.3.4';
  • or just use the VelvetBlue URL Updater plugin..

  • Thanks for the answer. The internal links work normal now.
    I have another quick question: How can I force all http://domain.com requests to be redirected to http://www.domain.com? I know it can be done from htaccess but I can't manage to get it done.

  • edit /etc/apache2/sites-available/default and change

    AllowOverride None
    

    to

    AllowOverride All
    

    Next, add this to the .htaccess:

    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^www\.
    RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
    

    Finally, run this:

    service apache2 reload
    
  • Thanks a lot! Everything is working perfectly!

Have another answer? Share your knowledge.