• Resolved altgr

    (@altgr)


    Hi,
    I would like to prepare my site for an URL change and for a possible server change.

    I did my home work and searched the net. I found this two articles in the Codex:
    http://codex.wordpress.org/Changing_The_Site_URL
    http://codex.wordpress.org/Moving_WordPress

    I read them a couple of times but sorry I don’t get them…
    Could someone please help me to explain these issues?

    1. Earlier when I configured my webhost I had to assign a folder to every domain I use. So now every one of my domains are linked to a separated folder in the host’s backend (cpanel). So why do I need at all to set “Home” and “Site URL” in WP? And could the WP setting and the host backend setting be in conflict?

    2. “The “Site URL” setting is the address where your WordPress core files reside.” –> My WP files are in a folder on my server. So it’s not an URL, it’s a folder address relatively to my home root. What should I enter here?

    3. “The “Home” setting is the address you want people to type in their browser to reach your WordPress blog.” –> If have two domains pointing to the same site which one should I enter here? The “main” one which representsthe hole site and every subpage? So the domain I want people to see when they browsing my site?

    4. Basically I don’t get the two label (Site URL and Home). Aren’t they reversed? The “Home” should be the file location, and the “Site URL” should be the main domain…

    5. I always tought WP – as being a CMS – stores every inner site element location as a relative link. But now I see images aren’t stored as media folder IDs but direct file links. Is it the standard way of inserting images to a WP site or my sites are build poorly? Can you suggest a best way to fix these image links after moving my site?

    6. Could someone please give me some clear instructions what to change in WP if I am not moving my site (neither to an other server neither to an other folder) I am only changing the domain (the URL which points to my site)?

    Thanks all of you!
    John

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi altgr!

    Let me tell you first that it’s great to meet someone who actually did the homework before asking the question. Anyway let’s get to the point…

    If you don’t move your WP site anywhere else (like folder or server change) there’d be not much to do. What I would do in such case is:

    1) while an old domain is still working (so that your site is accessible at the current address), I’d point the new domain to the server and in cpanel configure it to point to the same directory (folder) as the old one.
    2) Next I’d login to my wp-admin (still using old address), go to “Settings”->”General” and update fields “WordPress Address (URL)” and “Site Address (URL)” with the new domain. For example:

    – now both fields are set to “http://foo.bar/blog”
    – new domain is new.bar so set it to “http://new.bar/blog”

    3) Try to type “new.bar/blog” into the browers and see if it works. It should. In case it doesn’t try this:

    Install this plugin (wp-admin should be still accessible): https://wordpress.org/plugins/search-and-replace/ and do quick search and replace (search for old domain, replace with new). I think however that this step won’t be necessary unless after switching off the old domain images (or other media files) stop showing.

    This is definitely one of the more confusing aspects of WordPress!

    There are some plugins that can handle the URL changes for you – check out Duplicator, for example: https://wordpress.org/plugins/duplicator/

    But, if you want to understand how this works, here’s a summary – there’s a hosting part, and a WordPress part

    The hosting part

    Your host maps a domain to a file location on the server. This is called the “Domain Root Folder”.

    So, for example, in cPanel you said that the root of “foo.com” is a folder like /home/altgr/public_html/foo.com.

    You can test this out for yourself. Put a simple test.html file in that directory, and then access it at the url http://foo.com/test.html

    You can map multiple domains to the same folder on your host (so foo.com, foo.net, and foo.org could all use the same set of files).

    The WordPress part

    The WordPress settings are for generating URL’s that come out of WordPress. So, if you tell WordPRess that “Home” is http://foo.com/, then WordPress will produce links like http://foo.com/about or http://foo.com/?p=1

    Your web server will then take that link, and find the file that’s used to produce that link. If you don’t have a WordPress file there, then you won’t see your website. So it’s important that WordPress generates URL’s that your web server can translate correctly.

    The SiteURL is the URL for your wp-admin, as well as for other WordPress files. It’s used to generate links to your style.css file, media files, javascript, your theme files, etc.

    If you are NOT changing your domain (e.g. just moving the server), you don’t have to make any changes to your WordPess database – you just have to put your WordPress files and database in the right place.

    If you point multiple domains to the same WordPress instance, they will all find the homepage of your site, but all the links will be whatever you set in your “HOME” URL setting.

    If you installed WordPress in a subfolder (~/domain.com/wordpress/…) then your site URL should be “http://domain.com/wordpress”. This is what the “Moving WordPress” page suggests.

    Links that have been inserted in the content of your posts will have the full domain. There are lots of reasons for this, but it’s fairly easy to work around with the Search-and-Replace plugin suggestion from Adam.

    You should also check in your theme’s options for hard-coded URL”s (such as to logos, headers, etc). These will need to be reset if you change your domain or move files around.

    Thread Starter altgr

    (@altgr)

    Clear! Thanks both of you!!

    Today I changed the domain successfully! 🙂
    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘change URL / move site’ is closed to new replies.