Modify the Subsite (Web) URL
Scenario/Problem: You want to rename the relative URL name for a subsite.
Solution: Use the Set-SPWeb cmdlet with the RelativeURL parameter.
You can easily change the name of the relative URL in which a subsite is accessed by using the Set-SPWeb cmdlet. Provide the URL of the site as the Identity parameter, and use the RelativeURL parameter to provide the new URL, as shown in Listing 8.16.
Listing 8.16. Renaming a Subsite
Set-SPWeb -Identity "http://sp2013/sites/sitecol/newsubsite"-RelativeURL teamsites
Notice that the RelativeURL value is not a full URL. The example essentially renames the subsite URL from newsubsite to teamsites. Therefore, after execution, the subsite is accessed by http://sp2013/sites/sitecol/teamsites/. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access