• Resolved Roger Watts

    (@ra1953watts)


    I have a test website installed in a primary domain. To be able to use “paid” plugins from the site I’m upgrading I have to install wp on a subdomain with specific naming conventions (I’ll call this dev.mysite.com).
    I have used cPanel to create this subdomain and it is now shown, in the file manager, as being at the same level (outside of) public_html. There is an A-record pointing to this subdomain which has propagated ok.
    I have several failed attempts to install wp into this subdomain and I’m not totally certain that I was getting clear separation of the 2 installations; neither of them was accessible <sigh>.

    I have removed wp from the subdomain and got the primary site working again.

    Is my subdomain all right being at the same level as public_html for my primary site?
    Should I do anything particular to my original wp installation before I try to install in the subdomain?
    I do not need to keep the installation in the primary domain once it is working in the subdomain. Having said that, I don’t want to lose work I have done thus far.
    I have so far tried using Duplicator Pro; also installing through my host’s Installatron.
    Right now, I have an almost empty subdomain to play with.
    TIA.

    • This topic was modified 1 year, 1 month ago by Roger Watts. Reason: Correction of bad grammar!!!
Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @roger,

    Setting up WordPress for subdomains with a document root located outside of public_html should not pose any problems.

    You’ve already tried using Duplicator Pro, If these methods didn’t work for you, here’s a general guide on how you can manually move your WordPress installation from the primary domain to a subdomain:

    Note: Before making any changes, it’s always a good idea to back up your website to prevent data loss.

    Steps to Manually Move WordPress to a Subdomain:

    • Backup Your Website:Use a backup plugin like UpdraftPlus or any other method provided by your hosting provider to create a backup of your entire WordPress site.
    • Create a Subdomain:Log in to your hosting control panel and create a subdomain where you want to move your WordPress site.
    • Copy Files:Connect to your server using FTP (File Transfer Protocol) or use the File Manager in your hosting control panel.Copy all the files from the current WordPress installation on the primary domain to the directory of the newly created subdomain.
    • Export Database:Export the database of your primary domain using tools like phpMyAdmin or any database management tool provided by your hosting provider.
    • Create a New Database:In your hosting control panel, create a new database for your subdomain.
    • Import Database:Import the database backup you made earlier into the new database you created for the subdomain.
    • Update Site URL in the Database:Open the database using a text editor or a database management tool.Look for the wp_options table and update the siteurl and home values to match the new subdomain URL.
    • Update wp-config.php:In the subdomain’s WordPress directory, find the wp-config.php file and update the database connection details if necessary.
    • Update Permalinks (Optional):Log in to the WordPress admin panel of your subdomain and go to Settings > Permalinks. Save the permalink settings to refresh the links.
    • Test the Subdomain:Visit your subdomain in a web browser to check if everything is working as expected.
    • Update Links (Optional):If your content contains absolute links pointing to the primary domain, you might need to update them to the subdomain manually.

      I trust that this will assist you in resolving the issues with your subdomain.
    • This reply was modified 1 year, 1 month ago by MilesWeb.
    • This reply was modified 1 year, 1 month ago by MilesWeb.
    • This reply was modified 1 year, 1 month ago by MilesWeb.
    • This reply was modified 1 year, 1 month ago by MilesWeb.
    Thread Starter Roger Watts

    (@ra1953watts)

    @milesweb

    Thanks. I’ll have a look at this and post a note of the outcome.

    Thread Starter Roger Watts

    (@ra1953watts)

    @milesweb

    Thanks for that. I have now got an operational site in my subdomain. I did have trouble getting wp started; after 5 minutes of shagging around I cleared my browser cache which got rid of chrome putting www in front of the url. I’ve now updated the dns records and all’s well ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Confusion about subdomains’ is closed to new replies.