• My site is currently a .com, I’d like to change it to .com.au

    The site is not moving at all, everything is staying where it is, all that needs to change is the domain.

    Obviously I’d like the .com URLs to now 301 to the .com.au.

    Can anyone suggest the most painfree way to do this? Obviously I could just easily change the domain in the admin panel, but how to I ensure that mysite.com/test 301s to mysite.com.au/test?

    Thansk!

Viewing 7 replies - 1 through 7 (of 7 total)
  • How long has it been since you made this DNS change? DNS propagation takes 24-72 hours typically.

    Thread Starter AFS_website

    (@afs_website)

    I haven’t changed anything yet, I’d like to know how to do it without breaking anything and having all the 301s working.

    Thread Starter AFS_website

    (@afs_website)

    I already have both domains, i just need to be using the .au, not the .com as it currently is.

    If you’re purely changing the URL and keeping the site on the same server (and your DNS is already set up) then you can simply go to your dashboard Settings > General and change the WordPress Address and Site Address.

    You should also make sure that your .com is parked and forwarding to the .com.au address.

    After you’ve made the changes you may lose some images or break some links, this is especially true if you’ve hard written them into pages although WordPress does a pretty good job of changing most links and paths.

    Thread Starter AFS_website

    (@afs_website)

    Thanks juslooken. I know I can do that, what I am more concerned about it losing the deeper links for example mysite.com/example –> mysite.com.au/example

    Is there a plugin that automatically generates 301 redirects?

    I am sure there are plugins to do this but I’ve always run a command an SQL command in phpMyAdmin to change things site-wide.

    I’ll include the code below with a strong caveat. If you get this wrong you will break your site so I can’t stress how important it is to back up your MySQL database first.

    UPDATE wp_posts SET post_content = REPLACE (post_content,'Item to replace here', 'Replacement text here');

    You can also do the same with the GUID

    UPDATE wp_posts SET GUID = REPLACE (GUID,'Item to replace here', 'Replacement text here');

    Repeating the warning – BACK UP THE DATABASE FIRST

    Thread Starter AFS_website

    (@afs_website)

    This is what I did – it seems to be working perfectly now:

    I changed the domain in wordpress to the .au, then did this in .htaccess

    Options +FollowSymLinks -MultiViews
    RewriteEngine on
    # if requested hostname is non-blank
    RewriteCond %{HTTP_HOST} .
    # and if requested hostname is NOT “www.newdomain.com.au”
    RewriteCond %{HTTP_HOST} !^www\.newdomain\.com\.au
    # redirect to same object in correct domain
    RewriteRule (.*) https://www.newdomain.com.au/$1 [R=301,L]

    Thanks for everyone’s help though!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Change domain – everything on same server, only change domain.’ is closed to new replies.