Changed From Subdomain to Subfolder But Subdomains Still Excists

Hi there,

I just changed my multisite setup from subdomain to subfolder using this guideline:
https://premium.wpmudev.org/blog/change-multisite-sub-directories-sub-domains/

Now, when I want to register for a new site, just like a new user would do, it does create a subfolder structured subsite. But when looking for existing subsites (ones that are made before changing over to subfolder) then I only get subdomain structured subsites

I'm using buddypress on my mutlisite setup with wordfence. I emptied any cache plugins and run a "update network" via Network Admin. Unfortuanlty old websites still exists under a subdomain and not subfolder.

As you can see here:
http://jobboard.careertiger.co.nz
http://www.careertiger.co.nz/test12345/

Any suggestions on how to make sure my entire network is on subfolder?
Cheers,

Ronald

  • Sajid

    Hi Dutchman,
    Hope you are doing good today!

    Did you completed the last step in the guide ? This is to ensure the existing subsites redirects to new URL accordingly.

    Visit your super admin dashboard and go to Tools > Network Setup. Copy the rules that are displayed for your .htaccess file and make those edits in your actual file, then save it and upload it back to your site if you chose to use FTP or SSH.

    Also, what you mean by the sub-domains still there ? Are they listed in Network -> Sites with old URL ?

    If you could enable support staff access so I could take a closer look. To grant access go to WPMU DEV -> Support -> Support Access -> Grant Access or see this manual.

    Take care and have a nice day :slight_smile:

    Best Regards,
    Sajid

  • Dutchman

    Hi Sajid,

    I have done the last part as well and changed it to:

    # BEGIN WordPress
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L]
    RewriteRule ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]
    RewriteRule . index.php [L]
    # END WordPress

    I also granted support access for you to have a look.
    Cheers,

    Ronald

  • Sajid

    Hi Dutchman,
    Hope you are doing good today!

    Thanks for granting support staff access and more details. The .htaccess file looks correct and redirecting the sites correctly.

    However, I saw that the URLs of old sites are still same over subdomains. For instance this subsite, http://jobboard.careertiger.co.nz/. I changed the URL from http://jobboard.careertiger.co.nz/ to http://careertiger.co.nz/jobboard/ in Network -> Sites -> Edit Site -> Info ->
    Site Address (URL) and it worked perfectly fine for me.

    So, you have to change the links of old sites like above, according to new setup to make those work on subdirectory. As mentioned in the article, unfortunately there is no one-click button to do it automatically so you must change the address manually for each site.

    Additionally, I will also suggest the author of this article to include the above information of updating the links of existing subsites manually.

    Take care and have a nice day :slight_smile:

    Best Regards,
    Sajid

  • Dutchman

    Thank you Sajid,

    That makes sense, I just read it wrong. I thought only content, as in previous created pages and posts that had old url's. I will change it all now manually.

    Just noticed that when changing the urls into folder structure it doesnt work on both http://www. and with out www (just http://). For example:

    You changed the subsite jobboard into: "http://careertiger.co.nz/jobboard"
    That works fine, but when users type in "www.careertiger.co.nz/jobboard" (with the www) it redirects to the main site.

    How can I resolve this?
    Cheers,

    Ronald

  • Sajid

    Hi Dutchman,
    Hope you are doing good today :slight_smile:

    For me it works with www this time and redirected to home page without www. That means you have a rule in your .htaccess file to redirect non-ww to www that have the URLs hard coded.

    So, you need to find that code and fix it according to your new structure. That, I can see you already started playing with it.

    Take care and have a nice day :slight_smile:

    Best Regards,
    Sajid

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.