Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7618973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T03:32:31+00:00 2026-05-31T03:32:31+00:00

I noticed on fiddler that [RequireHttps] does status code 302 redirects instead of 301.

  • 0

I noticed on fiddler that [RequireHttps] does status code 302 redirects instead of 301. I’m not sure how this makes sense…

If you are saying that a controller [RequireHttps], then you never-ever want people to go visit the Http version of that page. So why isn’t a permanent redirect… telling the search engines “please update your links permanantly to the https version of this page”.

If this makes sense, and i’m right, is there a way to change it to 301 redirect?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T03:32:32+00:00Added an answer on May 31, 2026 at 3:32 am

    It seems as if the choice to go with 302 over 301 was a little arbitrary to begin with. However, it does not necessarily follow that every URL is going to “have” to utilize the HTTPS scheme. There very well could be a page that allows access from both HTTP or HTTPS even if it may encourage the latter. An implementation where this may occur could have some code wired up to determine whether or not to use HTTPS based on some special criteria.

    As a case scenario, take a look at Gmail. Within the settings, one is capable of allowing or disallowing the HTTPS protocol throughout large portions of the application. Which code should be returned then? 301 wouldn’t be accurate, as it isn’t “permanent”…only a change at the behest of the user. Sadly, 302 isn’t quite accurate either because a 302 error implies that there is intent to change the link back at some point in the future (related reference http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html).

    Granted, Gmail is a rough example because the portions of the site that allow that option are not typically indexed by a search engine, but the possibility still exists.

    And to answer your final question, if you want a different status code in ASP.NET MVC (which I assume you’re using from the small syntax example), it is possible to change with a simple, custom attribute:

    public class MyRequireHttpsAttribute : RequireHttpsAttribute
    {
        public override void OnAuthorization(AuthorizationContext filterContext)
        {
            base.OnAuthorization(filterContext);
    
            if (!filterContext.HttpContext.Request.IsSecureConnection)
                filterContext.HttpContext.Response.StatusCode = (int)HttpStatusCode.MovedPermanently;
        }
    }
    

    Now all actions that implement the attribute should return a 301 status code when accessed via the HTTP protocol.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I noticed that most scripts for e-mail validation do not use DNS information to
Upon invsetigating 'mu is too short's answer to this question , I noticed that
I've noticed that the CSS3 scale attribute does really bad things to jquery ui,
I was testing my website with Fiddler and noticed that web server always returns
Trying to debug some ajax calls not working properly in IE, i noticed that
Noticed this today when a patch was submitted with the following line: lblCompletionTime.Text =
I noticed the existence of Microsoft.VisualStudio.TestTools.UnitTesting.PriorityAttribute. From reading a little about it, it does
I noticed that various systems use various characters as the replacent for illegal ones
I noticed that on my Vista and XP machines, the automatic update is asking
I noticed that JavaScript's new Date() function is very smart in accepting dates in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.