Go to Google Groups Home    microsoft.public.sharepoint.portalserver
RE: Bad site URL name

Eric <eri...@nospam.nospam>

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
!!!! ");
        }
    }

}