Page 1 of 1
Word Press: locally hosted uploaded to live, wants *.local
Posted: Mon Aug 17, 2015 8:53 am
by simonmlewis
Hi
This is an issue I have had the other way around, so maybe just a reminder is needed.
I've built a word press site for someone locally. ie.
http://theirsite.local
I have uploaded the files and database to the live server, but all links, including just popping in /wp-admin redirects the user to ".local".
I'm sure it was code I put into wp-config.php. Something that overrides it doing that.
Any clues?
Re: Word Press: locally hosted uploaded to live, wants *.loc
Posted: Mon Aug 17, 2015 8:57 am
by Celauran
Pop this into your wp-config.php
Code: Select all
define('WP_HOME', 'http://their.actual.url');
define('WP_SITEURL', 'http://their.actual.url');
Should sort you out.
Re: Word Press: locally hosted uploaded to live, wants *.loc
Posted: Mon Aug 17, 2015 9:03 am
by simonmlewis
That's the one. Brilliant Thanks.
Re: Word Press: locally hosted uploaded to live, wants *.loc
Posted: Mon Aug 17, 2015 4:12 pm
by twinedev
be sure to check for any post content that has links/images in them. Unless you do a S/R across the table or use a migrate plugin, while menus and such will be in the right place, content references will still be point to a full url of something like:
Code: Select all
<p>If you need more info, please <a href="http://theirsite.local/contact-us">contact-us</a>.</p>
Re: Word Press: locally hosted uploaded to live, wants *.loc
Posted: Fri Aug 21, 2015 8:12 am
by simonmlewis
Got a new issue related to this one.
We had a site all under Word Press in the root of the live area.
The client then decided to do a custom site in the root, and move the WP Blog over to a /blog folder.
I've moved it.
I've updated wp-config.php with the code you suggest, and the site loads. But anything under the site fails.
So for example:
http://www.site.com/blog/hello-there
That goes to the index.php template in the root.
The htaccess file in the root is setup correctly. I am showing both HTACCESS files below:
Root:
Code: Select all
DirectoryIndex index.php index.html index.htm
order allow,deny
allow from all
RewriteEngine On
Options +FollowSymLinks
Options +Indexes
RewriteRule ^(blog)($|/) - [QSA]
RewriteRule ^([^/\.]+)/?$ index.php?page=$1 [L]
RewriteRule ^$ index.php [L]
Blog HTACCESS:
Code: Select all
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Re: Word Press: locally hosted uploaded to live, wants *.loc
Posted: Fri Aug 21, 2015 8:18 am
by Celauran
Did you update WP_HOME and WP_SITEURL to reflect the new location?
Re: Word Press: locally hosted uploaded to live, wants *.loc
Posted: Fri Aug 21, 2015 8:26 am
by simonmlewis
No.... how?
Re: Word Press: locally hosted uploaded to live, wants *.loc
Posted: Fri Aug 21, 2015 8:32 am
by Celauran
Look at the post earlier on. You set WP_HOME to whatever.co.uk. You then moved the site to whatever.co.uk/blog/