URL routing and permanent page redirection for old page - asp.net

suppose our company has website which was developed by asp.net web form v1.1. it is running for last 5 year. people search google by keyword and got the link to come to our site...it means google cached all the pages of our site. now our company planing to develop our site with asp.net 4.0 and our company CTO want to use asp.net 4.0 routing feature for search engine friendly. i am aware of how to use url routing feature....here is small sample snippet of url routing.
for our new website pages name will be change. so when some one will search google and get link and when click on those link then request will come to our site but page not found will show because page name will be changed. so how to write the logic in such a way as a result when old request will come then routing will redirect to right page and also do the permanent redirection for google as a result from the next time user will get right page url. so my concern is how to write the logic which will drive the user to right page if the old page does not exist, the user will be redirected to right page using routing. please help me with code & concept. thanks

You need to use a HTTP 301 Permanent Redirection
Using .NET Framework v4:
Response.RedirectPermanent("NewPage.aspx");
EDIT:
I jumped in too quickly there... a good MVC solution would be: http://www.eworldui.net/blog/post/2008/04/25/ASPNET-MVC-Legacy-Url-Routing.aspx
This will redirect the request to the right place and return a 301 back...

If you do it via MVC, you will always have to manage those old routes. I think the best way is tu use directly IIS for this scenario. The url module in IIS allows you to configure permanent redirects very easily.

I am not an expert of MVC, infact a starter, so the solution that comes in my mind is you will have to register all routes for your existing pages like:
routes.MapRoute(
"BooksCategory", // Route name
"products/books.aspx", // URL with parameters
new { controller = "Products", action = "Browse", category = "Books" }
);
You can enhance it according to your needs.

I's suggest using a hybrid of this tools. You should return 301 as it's a permanent move. Google should pick-up on that when it starts scanning your new site.
I'd suggest you also need to keep your legacy urls separate, so they don't interfere with the current site. At some point in the future, perhaps when this new site becomes the legacy site, you'll want to organise your urls. By knowing what's needed by the app & what's for SEO might help.
You can probably do your SEO redirection using IIS and it's redirection module. Also, have look at Googles (and Bings) webmaster tools. They should help you figure our what the search engine is seeing on your site.

Related

From wordpress to SPA application - SEO issues

I need to test in terms of SEO a new page which was exported from wordpress to single page application. I want to keep my rank in search results. Unfortunately I am not sure how to do it properly.
Could you please give me any advice?
I know that I need to verify sitemap and broken links. Could you please recommend any tools to do it automatically?
The most important thing to do is to use the same URLs you have from your old website, or use 301 redirect method to redirect the old URLs to the new one.
Regarding the one pages, its not good for SEO since all your content will be in the same page, and here you can't target many keywords.
Still you can use one page website with advanced techniques to rank one many keywords but here it will affect the UX.
Regarding the XML site, since you have one page in your new website, you have to redirect all the pages to the new one using 301 redirect or you will have many 404s in the webmaster tool.

Google cached url for specific site and parmanent url redirection

first i like know how can i see what are the pages are cached of my web site. say my web site is www.mysite.com
i am going to change few urls of my site but there is one problem that i may loose SEO. suppose google cached this page of my url like
www.mysite.com/detailproduct.aspx?id=200 now i have change the location and name of the page. say now detail product name change to product and url looks like
www.mysite.com/catalog/products.aspx?id=200 so when people search google and if this link www.mysite.com/detailproduct.aspx?id=200 comes in google search and if user click on this link then no relevant page will display. so first of all i need to know what are the different pages has been cached of my web site by google if i know then i can write permanent redirection logic as a result google cache pages url will be change..i guess.
if anyone know any best practice to handle this situation then please discuss in details. the situation is few page name and location has been change and if user search google and if old page url comes then no page will display when user click on those link. i want to handle this situation in best way....what is all of your suggestion. thanks

How to suspend website for users but left it activated for the developer?

I would like to set a page on my website "Coming soon",and open the website when the update is finished.
My website is on host with plesk panel, so I suspended my site and edited the "temporary unavialable service" error page. but now as the developer i cannot check my website( I have to check it on the host and not in the IDE).
What should I do?
Using Url Rewrite you could do a few different things, here are a few of the easier ones:
Redirect by IP. Send everyone that doesn't match your IP address to a maintenance page (make sure you use a 302). If you're on a network where everyone has the same external IP and users on that network are accessing the site, this could be an issue.
Redirect by (lack of) a querystring parameter. This will work if you just need to view and refresh a single page, but if you need to click around through the site it's not going to work.
Redirect by (lack of) a cookie. Have Url Rewrite look for a cookie and if it's not present, redirect to maintenance page. This is probably the best solution of the 3 as it avoids the pitfalls of the other two approaches. The cookie will persist for however long you tell it to so you won't get redirected when you click through as you would with the querystring approach, and the redirects will work for everyone that doesn't have a cookie set- so everybody but you.
There are plenty of examples of all of these approaches on this site and on Webmasters.StackExchange and all over the web that can be found with quick search.
The easiest answer is leave your site up with the home page one of the static pages of your asp.net website and have your page for the site that you are working on called something like home2.aspx. I'm that way people that go to your site without a specific page will get the under construction page and you just need to add the URL of your test page when you deploy

How to redirect to the particular web site page in asp.net?

I'm developing one web site. In that web site I'm redirecting control to the another site. After completing work on another web site I want to be back on the my page from the my web site.
Suppose I want to redirect on the my web site page that is "abc.aspx". And I installed my web site on the Default virtual directory of my own pc.
I'm developing one shopping site & for payment I'm redirecting to the ccavenue site. And after completing shopping payment from the ccavenue website I want to redirect to the my shopping web site to the particular page , And I don't want to open the payment process on the another window. Than how to do this?
How to do this?
internal redirect:
Response.redirect("/abc.aspx")
this will do the same but maybe more readable:
Response.redirect(Request.Url.Authority+"/abc.aspx")
external redirect:
Response.redirect("http://www.derp.nu/foo")
Also put FALSE (as a parameter) after the link if you use session variables:
Response.redirect("/abc.aspx", false)
you can also do this:
You'll need that secondary site to perform the redirect. This is typically how ecommerce sites handle their interaction with payment portals. Alternatively, you could open the second site in a new window/tab, so that when the user closes that window, they are returned to your site by default.
Ideally, you need to give more context so people can answer to the particulars of your problem.
I got the solution on this, that is-
System.Web.HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority) + VirtualPathUtility.ToAbsolute("~/CCAvenueReturn.aspx")
which will return me the current url of my web site

How do I make Wordpress and an ASP.NET MVC 2webapp appear as one app to the end user?

I want to use Wordpress as a CMS for our domains content pages, and also provide links to and from CMS and our service which is an asp.net MVC 2 app, and I would really appreciate some guidance on this subject:
The first approach that comes to my mind is to bind my wordpress site to "thedomain.com" and then bind the service to "service.thedomain.com", and just have them point to the different websites in IIS. In my opinion it does not provide a seamless experience since we are effectively moving from one domain to another when navigating between MVC and wordpress.
How would you solve the task of making a wordpress app and an MVC app appear to be one?
A co-worker came up with an interesting solution to a similar issue and to solve it he wrote a theme in WP that shows all front-end results in JSON. Then, he used ajax/js to pull in content by sending a link to the WP server and pulling back in the JSON-formatted results. I have been meaning write up a blog post about it but the concept should get you started.
Basically, a main-server-page loads all the HTML then hits the wp-server and pulls in the necessary content. The main issue with doing it this way was the page would be empty if the user disabled JS or something else went wrong, but we never had that issue on a lightly-used server.

Resources