Message from discussion
Bad site URL name
Thread-Topic: Bad site URL name
thread-index: Acn6EU/q/+yhMKryT6ObZUUBUk/emg==
X-WBNR-Posting-Host: 206.169.97.226
From: =?Utf-8?B?RXJpYw==?= <eri...@nospam.nospam>
References: <6ACAAE13-E82B-43E2-BABD-854588037782@microsoft.com>
Subject: RE: Bad site URL name
Date: Tue, 30 Jun 2009 23:01:01 -0700
Lines: 37
Message-ID: <20A0E16A-1366-416F-9EB2-078D49F451EC@microsoft.com>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.3168
Newsgroups: microsoft.public.sharepoint.portalserver
NNTP-Posting-Host: tk2msftibfm01.phx.gbl 10.40.244.149
Path: g2news2.google.com!news4.google.com!feeder.news-service.com!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!weretis.net!feeder1.news.weretis.net!TK2MSFTNGP01.phx.gbl!TK2MSFTNGHUB02.phx.gbl
Here's the fix. The code was developed by MSFT support (as-is, no warranties).
Put the full bad URL in the first box: http://sharepoint/apps/badsiteurl.aspx
Put the good relative URL in the second box:/apps/goodsiteurl
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
!!!! ");
}
}
}