from subdirectory to subdomain

I have heared that it is better to use subdomain then subdirectories for my users to make their site. Do they need to delete all their hard work on their site or can the once who had already a subdirectory site work further on it while the newbies have a subdomainsite?

Cheers.

  • Ash

    Hello there

    I hope you are well today and thanks for asking the question.

    I have heared that it is better to use subdomain then subdirectories for my users to make their site.

    Yes, you heard right. And I don't think they need to delete their hard work :slight_smile:

    You need to do the following:

    1. BACKUP everything.
    2. In your wp-config.php file, there's a line that says Subdomains and it's set to 'false' right now. Change it to true and update htaccess file with subdomain rules as well.
    3. Fix the addresses for all the sites. Super Admin > Sites > Edit.
    4. Use .htaccess to redirect all old URLs to the new ones. Something like:

    # SubDomains
    RewriteCond %{HTTP_HOST} ^subsite.domain.tld [OR]
    RewriteCond %{HTTP_HOST} ^www.subsite.domain.tld
    RewriteRule ^(.*)$ http://domain.tld/subsite/$1 [R=301,L]

    Please let me know if it is helpful and feel free to ask more question if you have.

    Cheers
    Ash

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.