Word Press: locally hosted uploaded to live, wants *.local
Moderator: General Moderators
-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Word Press: locally hosted uploaded to live, wants *.local
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?
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?
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.
Re: Word Press: locally hosted uploaded to live, wants *.loc
Pop this into your wp-config.php
Should sort you out.
Code: Select all
define('WP_HOME', 'http://their.actual.url');
define('WP_SITEURL', 'http://their.actual.url');-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Re: Word Press: locally hosted uploaded to live, wants *.loc
That's the one. Brilliant Thanks.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.
Re: Word Press: locally hosted uploaded to live, wants *.loc
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>-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Re: Word Press: locally hosted uploaded to live, wants *.loc
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:
Blog HTACCESS:
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]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
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.
Re: Word Press: locally hosted uploaded to live, wants *.loc
Did you update WP_HOME and WP_SITEURL to reflect the new location?
-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Re: Word Press: locally hosted uploaded to live, wants *.loc
No.... how?
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.
Re: Word Press: locally hosted uploaded to live, wants *.loc
Look at the post earlier on. You set WP_HOME to whatever.co.uk. You then moved the site to whatever.co.uk/blog/