• Hello,

    My WP website URL is like this: https://blog.mydomain.com. I am going to be changing the domain name to https://mydomain.com. Just moving from the subdomain to the main domain.

    This looks like a simple task that I can do on the control panel at my site host, followed up with a search/replace on the site to catch any links with the old URL.

    I am concerned about external links that reference my site with the old URL. I want to be sure users who type the old address are rerouted to the new one.

    Does Safe Redirect Manager handle this? If so, do I need to enter a redirect for each page in the site?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Darin Kotter

    (@dkotter)

    @commontater Thanks for the question! Safe Redirect Manager won’t work in this situation, as it can only handle redirects when a request makes it to the WordPress layer. In this case, anyone that goes to the old URL (blog.mydomain.com) won’t end up making it to the WordPress layer and thus Safe Redirect Manager will never be loaded.

    For these types of redirects, your only option is to handle this as at the server level, so any request that comes to blog.mydomain.com gets automatically redirected to just mydomain.com. It depends on the host on how these redirects are managed but hopefully your host has an option to configure those.

    Thread Starter commontater

    (@commontater)

    Hi Darin,

    Thanks for responding. Regarding my site host, Siteground, I asked them how to move from the subdomain to the main domain, and they have a function that lets you change your domain name. However, their knowledge base is spotty and I didn’t get clarity on what to do after pressing “Go” on updating the domain name. Sounded like some manual work was required using their tool to search/replace in WordPress. They’re also not interested in helping solve site issues like this, only problems caused by their servers. Ha ha.

    But I appreciate your clarification of your plugin. I may want to use it for another site I am working on. ??

    A quick update: I see that Siteground has a function to create redirects, for example, domain blog.example.com (chosen from a dropdown), a path they describe as “e.g., /blog” (which isn’t what I would do), redirect type (301 or 302), and redirects to (no suggestions there).

    If I have changed the subdomain to the main domain, would this type of function be able to send users to the moved site if they typed blog.example.com? The goal, of course, is to send anyone who types the subdomain to the main domain. Or do I need it at all?

    Your thoughts/tips are appreciated!

    • This reply was modified 1 year, 5 months ago by commontater. Reason: additional info about site host

    @commontater yes, you can definitely do that. Other options are to handle it using a .htaccess file in the blog root folder or handle it using a PHP script.

    This is my preference order:

    • Siteground domain redirect
    • .htaccess file
    • PHP file

    However, I would test the Siteground redrect and make sure it works and it sends the user to the correct URL ( keeping request body, URL query, etc. ) by creating another subdomain https://test.mydomain.com and setting up a redirect for that domain to the main domain. Then, you may try to access https://test.domain.com/example-page/?with=search-query and see if redirects you to https://domain.com/example-page/?with=search-query

    This way you can test it before actually making the real move and you can plan ahead.

    Hope this helps.

    Cornel Raiu

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘change site URL from subdomain to main domain’ is closed to new replies.