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

I have been hosting my site in a shared environment at http://www.example.com/MYSITE/ for a while and I've built up a following there, I have decent ranking in Google and Bing, as well as I've been using the Facebook comment plug-in to allow users to comment on specific pages like http://www.example.com/MYSITE/Items/Details/52434.

I am moving to a dedicated server and the new version of the URLS listed above are http://www.example.com/ and http://www.example.com/Items/Details/52434

The site is an ASP.NET MVC site, I'd love to slam everything over, but I want anyone who goes to the old URLS to get sent to the right place. Is this something I can do with a web.config modification? I'd like to avoid a coding change if at all possible.

share|improve this question
add comment

2 Answers 2

Your best bet would be a permanent redirect response code for the old URL page, sending the client to the new fully qualified path to where the content now lives. I would imagine if you had things well structured, you could use a pattern match. Failing that, you can do many many perm redirects.

This is no guarantee, however, that you will be able to retain the SEO/traffic from before. It will still take some time to "transfer" any ranking as the various crawlers and indexers out there catch up with your new site.

share|improve this answer
    
Any thoughts on how I can do this with UrlRewrite? –  Nate Apr 9 '13 at 21:16
    
Unfortunately, I've no experience with MS-based web services. :( –  Wing Tang Wong Apr 9 '13 at 21:32
add comment
up vote 1 down vote accepted

Ended up doing a url rewrite. Added this to my web.config file:

<system.webServer>
  <rewrite>
    <rules>
      <rule name="Rewrite to article.aspx">
        <match url="^MYSITE/(.*)/(.*)" />
        <action type="Redirect" url="/{R:1}/{R:2}/" />
      </rule>
    </rules>
  </rewrite>
</system.webServer>

So my uris are now correctly redirected.

share|improve this answer
add comment

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.