Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have created several host-named site collections and now I have to rename a couple.

I used the command New-SPSite to create 'http://test1.domain.com' and was able to get everything going fine, but after using Set-SPSite with the following:

Set-SPSite -Identity http://test1.domain.com -URL http://test2.domain.com

The command appears to run correctly and if I run Get-SPSite I see my new URL listed, and if I try navigating to that URL in my browser it works fine.

The problem I have though, is that I set a custom login page and set it to '~/SitePages/login.aspx' which in theory should resolve to 'http://test2.domain.com/SitePages/login.aspx' but when I try to login it's pointing me to 'http://test1.domain.com/SitePages/login.aspx'

I have the same problem with the mobile version, in that when I try to navigate to 'http://test2.domain.com' in my iPhone the browser is being redirected back to the old site URL, test1.domain.com

Is there anything after the Set-SPSite command that i need to do? Thanks in advance

share|improve this question
    
How did you set the login page previously? –  James Love Feb 17 '12 at 20:13
    
~/SitePages/login.aspx ---------------- Sorry, I misread the question I think. I set the custom login page through central admin (I went to central admin, manage web applications, selected my web application and edited the custom login page under the authentication provider) –  Felipe Kettle Feb 17 '12 at 20:21

1 Answer 1

up vote 3 down vote accepted

Give your custom login page a fake name and then change it back to what you had previously(~/SitePages/login.aspx). This will append the new site name(http://test2.domain.com) to your login page and replace it with the old site name(http://test2.domain.com).

share|improve this answer
    
Okay, I was pretty skeptical at first that this would work, but I went to central admin, manage web applications, selected my web application and edited the custom login page under the authentication provider and it worked, both the login page link and the mobile site redirect point to the correct host name (test2.domain.com) –  Felipe Kettle Feb 17 '12 at 20:20
    
Sounds like this re-writes the entry in web.config for the web application. Good to know. +1 –  James Love Feb 17 '12 at 21:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.