I'm trying to replace the subdomain name from "news.domain.com/path/.." to "mobile.domain.com/path/..", using JavaScript
Any idea how to achieve this?
When you're ready to rename your subdomain, you can follow these steps to change. Only the account owner can rename the subdomain. In Admin Center, click Account in the sidebar, then select Appearance > Branding. In the Subdomain section, click Change your subdomain.
All subdomains are on the same level. You won't have a subdomain within a subdomain like you would a subfolder within a subfolder.
You create subdomains to help organize and navigate to different sections of your main website. Within your main domain, you can have as many subdomains as necessary to get to all of the different pages of your website.
I'm assuming that you want to change a string in the generic format xxxx.domain.com/...
into mobile.domain.com/...
. This regexp should do it in JavaScript:
var oldPath = "news.domain.com/path/";
var newPath = oldPath.replace(/^[^.]*/, 'mobile')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With