Mobile app version of vmapp.org
Login or Join
Harper822

: I am moving my site from a virtual directory to a dedicated server, can I save me SEO urls via a web.config change? I have been hosting my site in a shared environment at http://www.example.com/MYSITE/

@Harper822

Posted in: #301Redirect #AspNetMvc #Redirects #Seo #Url

I have been hosting my site in a shared environment at 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 www.example.com/MYSITE/Items/Details/52434.
I am moving to a dedicated server and the new version of the URLS listed above are www.example.com/ and 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.

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Harper822

2 Comments

Sorted by latest first Latest Oldest Best

 

@Annie201

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.

10% popularity Vote Up Vote Down


 

@Miguel251

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.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme