Forum Discussion

ctbrd03_133645's avatar
ctbrd03_133645
Icon for Nimbostratus rankNimbostratus
Feb 12, 2014

HTTP Redirect from a sub-domain to the root of the domain

We are doing a domain migration from a sub-domain to the root of the domain in the same forest. We are moving our sharepoint environment, and want to redirect any requests from the old sub-domain to the root, in case we miss any URL's in the site that need to be updated. For example: http://sharepoint.sub.domain.local/pages/home.aspx Needs to be converted to: http://sharepoint.domain.local/pages/home.aspx

 

Not only the top page, but we are hoping to use some sort of wildcard in case there are links on the sub sites, so any request to sharepoint.sub.domain.local, changes to sharepoint.domain.local, and retain whatever is after this in the URL. Any help will be greatly appreciated!!

 

1 Reply

  • Arie's avatar
    Arie
    Icon for Altostratus rankAltostratus
    when HTTP_REQUEST {
    
        if { [HTTP::host] equals "sharepoint.sub.domain.local" } {
    
            HTTP::respond 302 Location "http://sharepoint.domain.local/pages[HTTP::uri]"
    
        }
    
    }