The code below is part of a Visual Studio solution which I can't attach. Here's the meat of the code to get the gist of how the fix works:
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using Microsoft.SharePoint;
namespace UpdateServerRelativeURL { public partial class Form1 : Form { public Form1() { InitializeComponent(); }
private void button1_Click(object sender, EventArgs e) { SPSite mySite = new SPSite(textBox1.Text); SPWeb oWeb = mySite.OpenWeb(); oWeb.ServerRelativeUrl = textBox2.Text; oWeb.Update(); MessageBox.Show("URL of the site " + textBox1.Text + " updated !!!! "); } }
The root cause of this issue is that the URL of the sub site is not in a valid format after you change the web site address, so the site is not rendering. The resolution is to rename the sub site to a valid name by using the following command: Stsadm -o renameweb -url your unvaild url -newname a valid name.
Best Regards, Xuemei Chang Microsoft Online Support
Get Secure! - www.microsoft.com/security ===================================================== When responding to posts, please "Reply to Group" via your newsreader so that others may learn and benefit from your issue. ===================================================== This posting is provided "AS IS" with no warranties, and confers no rights.
I used the code from MSFT posted prior to your post to rename the subsite back but now the subsite is not getting indexed by the search engine. Is there anything that can be done about this?
> The root cause of this issue is that the URL of the sub site is not in a > valid format after you change the web site address, so the site is not > rendering. > The resolution is to rename the sub site to a valid name by using the > following command: > Stsadm -o renameweb -url your unvaild url -newname a valid name.
> Best Regards, > Xuemei Chang > Microsoft Online Support
> Get Secure! - www.microsoft.com/security > ===================================================== > When responding to posts, please "Reply to Group" via your newsreader so > that others may learn and benefit from your issue. > ===================================================== > This posting is provided "AS IS" with no warranties, and confers no rights
> I used the code from MSFT posted prior to your post to rename the subsite > back but now the subsite is not getting indexed by the search engine. Is > there anything that can be done about this?
> Thanks!
> "xuemei chang [MSFT]" wrote:
> > Hi,
> > Thanks for your post.
> > The root cause of this issue is that the URL of the sub site is not in a > > valid format after you change the web site address, so the site is not > > rendering. > > The resolution is to rename the sub site to a valid name by using the > > following command: > > Stsadm -o renameweb -url your unvaild url -newname a valid name.
> > Best Regards, > > Xuemei Chang > > Microsoft Online Support
> > Get Secure! - www.microsoft.com/security > > ===================================================== > > When responding to posts, please "Reply to Group" via your newsreader so > > that others may learn and benefit from your issue. > > ===================================================== > > This posting is provided "AS IS" with no warranties, and confers no rights
The solution you posted is much better than the one than the one I posted earlier. I was wondering how much time did it take to arrive at your solution?
> The root cause of this issue is that the URL of the sub site is not in a > valid format after you change the web site address, so the site is not > rendering. > The resolution is to rename the sub site to a valid name by using the > following command: > Stsadm -o renameweb -url your unvaild url -newname a valid name.
> Best Regards, > Xuemei Chang > Microsoft Online Support
> Get Secure! - www.microsoft.com/security > ===================================================== > When responding to posts, please "Reply to Group" via your newsreader so > that others may learn and benefit from your issue. > ===================================================== > This posting is provided "AS IS" with no warranties, and confers no rights