X

ASP.NET 4.0 SEO features: Response.RedirectPermanent()

ASP.NET 4.0 introduces some SEO improvements. Response has now new method calledRedirectPermanent(). This method performs same redirect as Response.Redirect() but it uses response code 301. You can find more information about HTTP response codes from HTTP 1.1 specification, chapter 10. Status Code Definitions.

Response.Redirect() returns 302 to browser meaning that asked resource is temporarily moved to other location. Permanent redirect means that browser gets 301 as response from server. In this case browser doesn’t ask the same resource from old URL anymore – it uses URL given by Location header.

To illustrate difference between Response.Redirect() and Response.RedirectPermanent() let’s look at simple example. We need one usual ASP.NET Web Application with Global.asax file. In Global.asax file we have to implement BeginRequest() method.

protected void Application_BeginRequest(object sender, EventArgs e)
{
    if (Request.FilePath == "/our-products.aspx")
    {
        Response.Redirect("/products.aspx", true);
    }
    if (Request.FilePath == "/about-us.aspx")
    {
        Response.RedirectPermanent("/about.aspx", true);
    }
}

Now let’s run our web application and make the following requests:

  • /our-products.aspx
  • /about-us.aspx

In both cases we will be redirected but redirections are different. Here is my little mix of FireBug outputs for these requests and I think it is very self describing.

Response.RedirectPermanent() has also overload with one parameter, just like Response.Redirect() does. If you have pages that exist in search engines but are moved to other location in your application then Response.RedirectPermanent() helps you build redirection controlling mechanism that likes to search engine spiders.

Liked this post? Empower your friends by sharing it!
Categories: ASP.NET

View Comments (137)

  • Thank you Gunnar for your excellent previews of Asp.Net 4 !
    - Joe

  • also:
    Response.Clear();
    Response.Status = "301 Moved Permanently";
    Response.RedirectLocation = PathOrUrl;
    Response.End();

  • Because it sends out response to client. Not every HTTP request ends up with response that is shown to user as page. 301 and 302, by example, return header called Location that contains URL of page where client should go instead.

    302 is temporary redirect and that means that resource may be soon available in current address again. So, client has to check it always when the request is made. 301 is permanent redirect that tells client that resource is moved to another address and it will not be available on current address ever again.

    One of those clients is your browser and the other one is search engine spider. The last one doesn't like those 302 responses and that's why RedirectPermanent is important.

  • nice information but i have one question can one told me what happen if we used redirectpermanently.
    will it effect on search engine pages that it index ?

    what happen if we redirect paramently that page that Google index ? Page index remain or removed from the google.

    any told me ?

    thanks in advance

    yasir butt

  • It is good that we have this option available to redirect.

    I was looking to redirect all "non www" urls to "www urls". Can we do this at the server level(IIS 7 available available through websitepanel) itself or this is the only way available?

  • This is a really good read for me. Must admit that you are one of the best bloggers I have ever read. Thanks for posting this informative article.love it.

  • Тhank you for sharing your info. I really
    aрpreciate your efforts and I am wаiting for your next post thank you
    once again.

    Review my website embroidery

  • It's very simple to find out any matter on net as compared to textbooks,
    as I found this article at this site.

  • Hey I know this is off topic but I was wondering if you knew of
    any widgets I could add to my blog that automatically tweet my newest twitter updates.
    I've been looking for a plug-in like this for
    quite some time and was hoping maybe you would
    have some experience with something like this. Please let me know if
    you run into anything. I truly enjoy reading your blog and I look forward to your new
    updates.

  • My spouse and I stumbled over here coming from a different page and thought
    I should check things out. I like what I see so i am just following you.
    Look forward to looking at your web page yet again.

  • Hey! Do you use Twitter? I'd like to follow you if that would be ok.

    I'm definitely enjoying your blog and look forward to new
    updates.

  • Hello there! I could have sworn I've visited this site before but
    after browsing through many of the posts I realized
    it's new to me. Anyways, I'm certainly pleased I stumbled upon it and I'll
    be book-marking it and checking back frequently!

  • What's up to all, the contents present at this web page are
    really awesome for people knowledge, well, keep up the good work fellows.

  • Nice post. I used to be checking constantly this
    blog and I'm inspired! Extremely useful information specifically the remaining part :
    ) I take care of such information much. I used to
    be looking for this particular info for
    a long time. Thanks and good luck.

  • fantastic put up, very informative. I wonder why
    the other experts of this sector do not notice this.
    You should continue your writing. I'm sure, you've a huge readers' base
    already!

  • I go to see each day a few web sites and websites to read posts, but this weblog presents feature
    based content.

  • It's hard to find well-informed people for this topic, but you seem like you know
    what you're talking about! Thanks

  • Pretty section of content. I just stumbled upon your web site and in accession capital to assert that I get in fact enjoyed account your
    blog posts. Anyway I'll be subscribing to your augment and even I
    achievement you access consistently quickly.

  • Pretty nice post. I just stumbled upon your blog and wished to say that I have
    really enjoyed surfing around your weblog posts.
    After all I'll be subscribing in your rss feed and I'm hoping you write once more very soon!

  • Thanks for finally writing about > ASP.NET 4.0 SEO features:
    Response.RedirectPermanent() < Loved it!

  • Do you mind if I quote a few of your posts as long as I provide
    credit and sources back to your website? My blog is in the exact
    same area of interest as yours and my visitors would genuinely benefit
    from a lot of the information you present here. Please let me
    know if this alright with you. Regards!

  • I am sure this post has touched all the internet visitors, its really really fastidious paragraph on building up new weblog.

  • With havin so much written content do you ever run into any
    problems of plagorism or copyright violation? My site has a lot of unique content I've either authored myself or outsourced but it appears
    a lot of it is popping it up all over the internet without my permission.
    Do you know any solutions to help stop content from being
    stolen? I'd genuinely appreciate it.

  • id="firstHeading" class="firstHeading mw-first-heading">Search results

    Help

    English

    Tools

    Tools
    move to sidebar hide

    Actions

    General

  • Wһʏ We Fіnd it irresistible: Αlthough tһe cooling applicator
    ⲟf Revision Skincare’s eye cream iis ϲertainly
    a part of itѕ draw, it leaves an enduring impression attributable tο the convenience with whіch іt tackles
    eye sagging ɑnd drooping.

    mʏ page :: moisturizer

  • Good response in return of this query with genuine arguments and describing everything about that.

  • I don't know whether it's just me or if everybody else experiencing
    problems with your blog. It appears like some of the text within your content are running off the
    screen. Can somebody else please provide feedback and let me know if this is happening to
    them as well? This might be a issue with my browser because I've
    had this happen previously. Thanks

  • I would like to thank you for the efforts you've put in writing this website.
    I'm hoping to view the same high-grade content from you in the future as well.
    In truth, your creative writing abilities has motivated
    me to get my own blog now ;)

  • Every weekend i used to pay a quick visit this
    web page, for the reason that i want enjoyment, for the
    reason that this this website conations really fastidious funny
    information too.

  • Great items from you, man. I've be mindful your stuff previous to
    and you're simply too wonderful. I really like what you have acquired here, really like what you're stating
    and the way in which you assert it. You are making it entertaining and you continue to take
    care of to stay it sensible. I can not wait to learn much more from you.
    That is actually a tremendous web site.

  • Great beat ! I wish to apprentice while you amend your website, how can i subscribe for
    a blog site? The account aided me a acceptable deal.
    I had been tiny bit acquainted of this your broadcast offered bright
    clear concept

  • Amazing issues here. I'm very glad to peer your post.
    Thank you a lot and I'm looking ahead to contact you.
    Will you please drop me a mail?

  • Hi, after reading this amazing piece of writing i am too delighted
    to share my familiarity here with colleagues.

  • Magnificent goods from you, man. I have understand your stuff previous to and you are just
    too great. I actually like what you have acquired here, certainly
    like what you're saying and the way in which you say it. You make
    it entertaining and you still take care of to keep it sensible.
    I can not wait to read much more from you. This is really a terrific website.

  • At http://big-juggs.com, you'll locate a treasure trove of tantalizing images featuring voluptuous women happily displaying their enormous, gravity-defying breasts. These types of seductive beauties realize just how in order to tease and make sure you, offering up their own heaving bosoms inside the most attention grabbing poses. From lively squeezes and sexual licks to letting their enormous jugs hang free, our girls are here to satisfy the every fantasy plus take you with an unforgettable visual journey.

  • Remarkable! Its genuinely awesome article, I
    have got much clear idea concerning from this article.

  • The post about togel online resmi terpercaya is incredibly detailed.

    I follow a lot of togel blogs, but this one is consistently accurate.

    Even the smallest update is posted fast, especially for data
    hk prize.
    Great job!

  • Great write-up on jatengtoto slot. The RTP pattern matches what I saw
    during last night’s session.
    Including live results for jatengtoto slot really
    adds trust. Bookmarked for sure.
    Your prediction breakdown for jatengtoto slot is excellent.
    Following now.

  • This is hands down the best post I've seen about rtp slot.

    Your explanation of RTP levels, bonus timings, and trusted providers like pragmatic play is
    detailed and accurate.
    I especially liked how you broke down the peak spin times
    for slot 4d.
    Gives us a clear edge when deciding where to play.

  • You actually make it seem really easy together with your presentation however
    I find this topic to be actually something that I think
    I might never understand. It sort of feels too complex and very broad for me.
    I am having a look forward for your subsequent put up,
    I will attempt to get the grasp of it!

  • Wow, incredible blog structure! How long have you ever been running a blog for?
    you made blogging glance easy. The full glance of your website
    is magnificent, let alone the content material!

  • Hello! I know this is kinda off topic however I'd figured I'd ask.

    Would you be interested in trading links or maybe guest writing a blog post or vice-versa?
    My site addresses a lot of the same topics as yours and I think we could
    greatly benefit from each other. If you happen to
    be interested feel free to send me an e-mail.
    I look forward to hearing from you! Terrific blog by the way!

  • My partner and I stumbled over here coming from a different page and thought I
    should check things out. I like what I see so now i'm following you.
    Look forward to exploring your web page repeatedly.

  • Hello friends, how is everything, and what you want to say regarding this piece of writing, in my
    view its truly amazing designed for me.

  • Wow that was strange. I just wrote an incredibly long comment but
    after I clicked submit my comment didn't appear.
    Grrrr... well I'm not writing all that over again. Anyhow,
    just wanted to say excellent blog!

  • Hi there everyone, it's my first pay a visit at this web page,
    and piece of writing is genuinely fruitful designed
    for me, keep up posting these articles.

  • Why users still use to read news papers when in this technological globe all is accessible on web?

  • whoah this blog is great i like reading your articles.
    Keep up the great work! You already know, many people are looking around for this
    info, you can help them greatly.

  • Whats up very nice web site!! Guy .. Excellent
    .. Amazing .. I will bookmark your site and take the feeds additionally?
    I'm glad to find numerous helpful information here in the put up, we want work out more techniques in this regard,
    thank you for sharing. . . . . .

  • Hi, I believe your website could be having internet browser compatibility problems.
    When I look at your web site in Safari, it looks fine but when opening in IE, it's got some overlapping issues.
    I just wanted to give you a quick heads up! Apart from that, wonderful site!

  • It is the best time to make some plans for the future and it is time to be happy.
    I have learn this publish and if I may just I desire to
    recommend you few fascinating things or suggestions.
    Maybe you could write next articles regarding this article.
    I want to learn more issues approximately it!

  • After looking over a handful of the blog posts on your web page, I seriously like your way of writing a
    blog. I added it to my bookmark website list and will be checking back in the near future.

    Please visit my web site too and tell me how you feel.

  • Command respet with Count Dooku's lightsaber, designed ԝith a curved hilt for precision іn duls
    at SaberSaga. Find your perfect match today and feel tthe true power ⲟf tһe Force!

    My site star wars storyline

  • Command respet with Count Dooku's lightsaber, designed ԝith a curved hilt for precision іn duls
    at SaberSaga. Find your perfect match today and feel tthe true power ⲟf tһe Force!

    My site star wars storyline

  • Hi there to all, because I am genuinely eager of reading this weblog's post to be updated on a regular basis.
    It carries fastidious material.

  • I know this if off topic but I'm looking into starting my own weblog and was wondering what all is required
    to get set up? I'm assuming having a blog like yours would
    cost a pretty penny? I'm not very internet savvy so I'm not 100% positive.
    Any tips or advice would be greatly appreciated.
    Thanks

  • My spouse and I stumbled over here by a different page and
    thought I might as well check things out. I like what I see so now i am following you.
    Look forward to looking over your web page again.

  • If some one needs to be updated with hottest technologies then he
    must be pay a quick visit this web page and be up to date every day.

  • Hello, of course this piece of writing is actually pleasant and I have learned lot
    of things from it regarding blogging. thanks.

  • You could definitely see your skills in the article you write.
    The sector hopes for even more passionate writers like you who are not afraid
    to say how they believe. All the time go after your heart.

  • Hi there mates, nice piece of writing and nice urging commented at this place, I am in fact
    enjoying by these.

  • Hi my friend! I want to say that this post is amazing, nice written and include approximately
    all important infos. I would like to see more posts
    like this .

  • I just like the valuable information you provide on your articles.

    I will bookmark your blog and check again here frequently.

    I am slightly sure I'll be told plenty of new stuff proper right here!

    Good luck for the next!

  • First off I want to say terrific blog! I had a quick question which I'd like to ask if you do not mind.
    I was interested to know how you center yourself
    and clear your head before writing. I've had trouble clearing my mind in getting my thoughts out there.
    I truly do take pleasure in writing however it just seems like the first 10 to 15 minutes are lost just trying to
    figure out how to begin. Any suggestions or hints? Thanks!

  • Wenn du auf wilde MILFs stehst, dann bist du bei milfmutterfotos richtig. Hier bekommst du Erwachsenenfilm Pics von Frauen, die mehr als nur posieren wollen – sie brauchen Action. Alles frei verfГјgbar und voller grenzГјberschreitend.

  • milfmutterfotos.com bietet dir Porno mit MILFs, die in echten HГ¶riger Szenen alles geben. Schwarze Schwanze, offene MГјnder und heiГџe Hausfrau - Bilder wie aus deinen versautsten TrГ¤umen.

  • Asking questions are in fact fastidious thing if you
    are not understanding anything entirely, however this piece of writing presents
    pleasant understanding even.

  • Very great post. I just stumbled upon your blog and wished to mention that I've truly
    loved surfing around your blkog posts. In any
    case I will be subscribing on your rss feed and I hope you write once more soon!

  • Howdy, There's no doubt that your web site may be having internet browser compatibility
    issues. Whenever I take a look at your site in Safari, it looks fine
    but when opening in IE, it has some overlapping issues.
    I just wanted to give you a quick heads up! Other than that, wonderful site!

  • Hi there! I know this is kind of off-topic but I had
    to ask. Does building a well-established blog like yours
    require a lot of work? I'm completely new to operating a blog but I do write in my
    journal every day. I'd like to start a blog so I can easily share my experience and thoughts
    online. Please let me know if you have any suggestions or tips for brand
    new aspiring blog owners. Appreciate it!

  • BESTSEXPICS.NET is all about hard pussy work—old chicks with stilettos and see-through showing off and begging to be used. These aged old slut babes don't play around when it's fuck time.

  • Good article! We will be linking to this great post on our
    website. Keep up the great writing.

  • Howdy would you mind letting me know which web host you're working
    with? I've loaded your blog in 3 different browsers and
    I must say this blog loads a lot faster then most.
    Can you recommend a good hosting provider at a fair price?
    Kudos, I appreciate it!

  • BESTSEXPICS.NET is all about hard coochie work—old chicks with pumps and lingerie showing off and begging to be used. These experienced old slut babes don't play around when it's fuck time.

  • Thank you for the auspicious writeup. It in fact was a amusement account it.
    Look advanced to far added agreeable from you!
    By the way, how could we communicate?

  • Very good article! We will be linking to this great post on our website.
    Keep up the great writing.

  • This is myy first time pay a visit at here andd
    i amm actually pleassant to rdad everthing at alone place.

    Here is my site - source

  • Its such as you learn my mind! You appear to understand a lot
    about this, such as you wrote the e-book in it or something.
    I believe that you simply could do with a few percent to power the message home a bit,
    but other than that, this is fantastic blog.
    An excellent read. I'll certainly be back.

  • I think this is among the most vital information for me. And i'm glad reading your article.
    But should remark on some general things, The web site style is great,
    the articles is really excellent : D. Good job, cheers

  • I have been browsing online more than three hours today, yet I never found
    any interesting article like yours. It is pretty worth enough for me.
    In my view, if all webmasters and bloggers made good
    content as you did, the internet will be much more useful than ever before.

  • I visit every day some sites and information sites to
    read content, except this web site offers quality
    based posts.

  • Every weekend i used to pay a visit this web page, because i want enjoyment, as this this site conations
    actually good funny information too.

  • Hello! I just wish to offer you a huge thumbs up for your excellent
    info you have got right here on this post. I will be coming back to your website for more soon.

Related Post