I have a new SharePoint 2013. The site works fine with the URL https://sharepoint.mydomain.com/sites/main However I want users to be able to just enterhttps://sharepoint.mydomain.com only. I have tried using the SPSiteURL command but I get an error and I'm not sure if thats the method I should use anyway, if this is wrong or if there is a better way.
The syntax I used is:
$site = Get-SPSite 'https://sharepoint.mydomain.com/sites/main'
Set-SPSiteURL -Identity $site -Url https://sharepoint.mydomain.com -Zone Default
get the following error:
Set-SPSiteURL : Could not set URL for the site collection
https://sharepoint.mydomain.com/sites/main. This command can only be
run on a host-named site collection.
At line:1 char:1
+ Set-SPSiteURL -Identity $site -Url
https://sharepoint.mydomain.com
-Zone ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~
+ CategoryInfo : InvalidData: (Microsoft.Share...letSetSPSiteUrl:
SPCmdletSetSPSiteUrl) [Set-SPSiteURL], ArgumentException
+ FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletSetSPSit
eUrl
Thank you for any assistance!