undefined
Skip to content
Moz logo Menu open Menu close
  • Products
    • Moz Pro
    • Moz Pro Home
    • Moz Local
    • Moz Local Home
    • STAT
    • Moz API
    • Moz API Home
    • Compare SEO Products
    • Moz Data
  • Free SEO Tools
    • Domain Analysis
    • Keyword Explorer
    • Link Explorer
    • Competitive Research
    • MozBar
    • More Free SEO Tools
  • Learn SEO
    • Beginner's Guide to SEO
    • SEO Learning Center
    • Moz Academy
    • SEO Q&A
    • Webinars, Whitepapers, & Guides
  • Blog
  • Why Moz
    • Agency Solutions
    • Enterprise Solutions
    • Small Business Solutions
    • Case Studies
    • The Moz Story
    • New Releases
  • Log in
  • Log out
  • Products
    • Moz Pro

      Your all-in-one suite of SEO essentials.

    • Moz Local

      Raise your local SEO visibility with complete local SEO management.

    • STAT

      SERP tracking and analytics for enterprise SEO experts.

    • Moz API

      Power your SEO with our index of over 44 trillion links.

    • Compare SEO Products

      See which Moz SEO solution best meets your business needs.

    • Moz Data

      Power your SEO strategy & AI models with custom data solutions.

    NEW Keyword Suggestions by Topic
    Moz Pro

    NEW Keyword Suggestions by Topic

    Learn more
  • Free SEO Tools
    • Domain Analysis

      Get top competitive SEO metrics like DA, top pages and more.

    • Keyword Explorer

      Find traffic-driving keywords with our 1.25 billion+ keyword index.

    • Link Explorer

      Explore over 40 trillion links for powerful backlink data.

    • Competitive Research

      Uncover valuable insights on your organic search competitors.

    • MozBar

      See top SEO metrics for free as you browse the web.

    • More Free SEO Tools

      Explore all the free SEO tools Moz has to offer.

    NEW Keyword Suggestions by Topic
    Moz Pro

    NEW Keyword Suggestions by Topic

    Learn more
  • Learn SEO
    • Beginner's Guide to SEO

      The #1 most popular introduction to SEO, trusted by millions.

    • SEO Learning Center

      Broaden your knowledge with SEO resources for all skill levels.

    • On-Demand Webinars

      Learn modern SEO best practices from industry experts.

    • How-To Guides

      Step-by-step guides to search success from the authority on SEO.

    • Moz Academy

      Upskill and get certified with on-demand courses & certifications.

    • SEO Q&A

      Insights & discussions from an SEO community of 500,000+.

    Unlock flexible pricing & new endpoints
    Moz API

    Unlock flexible pricing & new endpoints

    Find your plan
  • Blog
  • Why Moz
    • Small Business Solutions

      Uncover insights to make smarter marketing decisions in less time.

    • Agency Solutions

      Earn & keep valuable clients with unparalleled data & insights.

    • Enterprise Solutions

      Gain a competitive edge in the ever-changing world of search.

    • The Moz Story

      Moz was the first & remains the most trusted SEO company.

    • Case Studies

      Explore how Moz drives ROI with a proven track record of success.

    • New Releases

      Get the scoop on the latest and greatest from Moz.

    Surface actionable competitive intel
    New Feature

    Surface actionable competitive intel

    Learn More
  • Log in
    • Moz Pro
    • Moz Local
    • Moz Local Dashboard
    • Moz API
    • Moz API Dashboard
    • Moz Academy
  • Avatar
    • Moz Home
    • Notifications
    • Account & Billing
    • Manage Users
    • Community Profile
    • My Q&A
    • My Videos
    • Log Out

The Moz Q&A Forum

  • Forum
  • Questions
  • Users
  • Ask the Community

Welcome to the Q&A Forum

Browse the forum for helpful insights and fresh discussions about all things SEO.

  1. Home
  2. Research & Trends
  3. SERP Trends
  4. 302 redirect on http but not on https

Moz Q&A is closed.

After more than 13 years, and tens of thousands of questions, Moz Q&A closed on 12th December 2024. Whilst we’re not completely removing the content - many posts will still be possible to view - we have locked both new posts and new replies. More details here.

302 redirect on http but not on https

SERP Trends
4
10
12.0k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as question
Log in to reply
This topic has been deleted. Only users with question management privileges can see it.
  • Direct_Ram
    Direct_Ram last edited by Apr 10, 2015, 11:04 AM

    Hi

    I have noticed using screaming frog that 302 redirect is in place but when checking the HTTACESS there no such thing in place.

    If I run a scan with: http://www.redirect-checker.org/index.php doing a test with: https://www. everything seems ok but then when I do: http://www. There is a 302 in place and seem to understand why.

    I have analysed the Httacess file and cant seem to locate anything that refers to the 302 any advise or previous experience would be great.

    Thanks
    E

    1 Reply Last reply Reply Quote 0
    • BlueprintMarketing
      BlueprintMarketing @Direct_Ram last edited by Apr 11, 2015, 7:45 PM Apr 11, 2015, 7:45 PM

      you're running Apache tomcat right?

      301 Redirect URLs.

      Redirect 301 /holidays/about-direct-traveller/british-travel-awards.asp /directtraveller/awards
      Redirect 301 /directtraveller/holidays/about-direct-traveller/british-travel-awards.asp /directtraveller/awards

      I am guessing this simply from you having this port open and having no issues with HTaccess 8443 is the default port of tomcat with ssl

      http://beamusup.com/generate-htaccess/

      1 Reply Last reply Reply Quote 0
      • BlueprintMarketing
        BlueprintMarketing @TheWebMastercom last edited by Apr 11, 2015, 7:29 PM Apr 11, 2015, 7:26 PM

        Johnson I agree thumbs up with Nginx could definitely be a as reverse proxy. the best way to tell would be to scan the ports but I will allow him to do that.

        I agree with you as well on the 302 issue

        He has to redirect using a 301 instead of a 302 from

        https://www.directtraveller.com/holidays/about-direct-traveller/british-travel-awards.asp

        https://www.directtraveller.com/awards
         I bet there are a few other 302's in there if there are one however I'm speculating. Crawling the site withhttps://www.deepcrawl.com/ or http://www.screamingfrog.co.uk/seo-spider/ will show him any 302's as far as the best way to redirect I agree with you again it is based on what type of server he is using.

        If MS ASP

        Ues

        http://www.rapidtables.com/web/tools/redirect-generator.htm

        http://www.rapidtables.com/web/dev/url-redirect.htm#asp-redirect

        ASP redirect

        old-page.asp:

        <%@ Language="VBScript" %>
        <%
        ' ASP permanent URL redirection
        Response.Status="301 Moved Permanently"
        Response.AddHeader "Location", "http://www.mydomain.com/new-page.html"
        Response.End
        %>

        http://ask.webatall.com/nginx/17733_nginx-redirect-http-to-https-and-non-www-to-ww.html

        From feed the bot you can see your site is unfortunately using 302's maybe that's on purpose if not you should change it to 301's.

        Final status code: 200
        1 Redirect(s)
        https://www.directtraveller.com/holidays/about-direct-traveller/british-travel-awards.asp 
        ** 302 redirect**
        https://www.directtraveller.com/awards

        If is is a Proxy

        http://wiki.nginx.org/HttpProxyModule#proxy_redirect

        http://wiki.nginx.org/Pitfalls#Using_If

        PS

        I would remove the nofollow on these links. Google likes TOS and privacy policies

        Nofollow links

        3 nofollow links

        • /terms-and-conditions
        • /resources
        • /privacy-policy  checked using http://www.feedthebot.com/tools/

        all the best,

        Tom

        1 Reply Last reply Reply Quote 0
        • Direct_Ram
          Direct_Ram @TheWebMastercom last edited by Apr 11, 2015, 11:42 AM Apr 11, 2015, 11:42 AM

          We have a redirect from HTTP to HTTPS and then have the following redirect on the httaccess file:

          #Redirect /directtraveller/holidays/about-direct-traveller/british-travel-awards.asp /directtraveller/awards

          Redirect /holidays/about-direct-traveller/british-travel-awards.asp /directtraveller/awards

          BlueprintMarketing 1 Reply Last reply Apr 11, 2015, 7:45 PM Reply Quote 0
          • TheWebMastercom
            TheWebMastercom @BlueprintMarketing last edited by Apr 11, 2015, 5:40 AM Apr 11, 2015, 5:40 AM

            Not necessarily.  He could be using Nginx as reverse proxy.

            He already said the http to https is working fine with my suggestion.  The problem is the redirect from one URL to another which what I gave him for the .htaccess doesn't address at all.

            ie.

            https://www.directtraveller.com/holidays/about-direct-traveller/british-travel-awards.asp
            to
            https://www.directtraveller.com/awards

            BlueprintMarketing 1 Reply Last reply Apr 11, 2015, 7:26 PM Reply Quote 1
            • BlueprintMarketing
              BlueprintMarketing last edited by Apr 11, 2015, 12:16 AM Apr 11, 2015, 12:13 AM

              The reason why the HTaccess file is not working for you is because you're running a server on Nginx instead of Apache's .htaccess  your server uses a "nginx config" this is why .htaccess   will not work properly. this will also show you why you're still running a 302 redirect instead of a 301 redirect

              http://www.redant.com.au/ruby-on-rails-devops/manage-ssl-redirection-in-nginx-using-maps-and-save-the-universe/

              https://www.digitalocean.com/community/questions/http-https-redirect-positive-ssl-on-nginx

              for referencing these URLs below will tell you everything you need to know about your configuration and how to set it up. I've placed a lot of redirects below because there are so many different ways of doing this below the two URLs where it says I recommend using this is the configuration that should be default on your server in order to force SSL

              http://nginx.org/en/docs/http/ngx_http_rewrite_module.html#return

              http://nginx.org/en/docs/http/ngx_http_core_module.html#server_name

              ** I recommend using this to fix use this on your nginx config file**

              _**`server {
                     listen         80;
                     server_name    www.domain.com;
                     return         301 https://$server_name$request_uri;
              }
              
              server {
                     listen         443 ssl;
                     server_name    www.domain.com;
              
                     [....]
              }`**_
              

              might be easier this way

              <code>server {
                     listen         80;
                     server_name    my.domain.com;
                     return         301 https://$server_name$request_uri;
              }
              
              server {
                     listen         443 ssl;
                     server_name    my.domain.com;
              
                     [....]
              }</code>
              

              you are still putting out 302's I double checked your server

              http://www.feedthebot.com/tools/headers/test.php

              https://www.directtraveller.com/holidays/about-direct-traveller/british-travel-awards.asp

              HTTP/1.1 **302 Found **
              Server: nginx/1.6.0 
              Date: Sat, 11 Apr 2015 02:59:23 GMT 
              Content-Type: text/html; charset=iso-8859-1 
              Connection: keep-alive 
              Location: https://www.directtraveller.com/awards

              Header transfer size: 199

              http://www.directtraveller.com/holidays/about-direct-traveller/british-travel-awards.asp


              301 Moved Permanently

              | Status: | 301 Moved Permanently |
              | Code: | 301 |
              | Server: | nginx/1.6.0 |
              | Date: | Sat, 11 Apr 2015 02:12:51 GMT |
              | Content-Type: | text/html; charset=iso-8859-1 |
              | Content-Length: | 370 |
              | Connection: | close |
              | Location: | https://www.directtraveller.com/holidays/about-direct-traveller/british-travel-awards.asp |

              https://www.directtraveller.com/holidays/about-direct-traveller/british-travel-awards.asp


              302 Found

              | Status: | 302 Found |
              | Code: | 302 |
              | Server: | nginx/1.6.0 |
              | Date: | Sat, 11 Apr 2015 02:12:51 GMT |
              | Content-Type: | text/html; charset=iso-8859-1 |
              | Content-Length: | 296 |
              | Connection: | close |
              | Location: | https://www.directtraveller.com/awards

              |

              | Status: | 200 OK |
              | Code: | 200 |
              | Server: | nginx/1.6.0 |
              | Date: | Sat, 11 Apr 2015 02:12:52 GMT |
              | Content-Type: | text/html |

              you can convert Htaccess to  nginx using this tool http://winginx.com/en/htaccess

              however I would force SSL instead of use a rewrite through the converter. The redirects below work but I would use the server-side redirect labeled use this

              Check out Engine Yard for more redirects I have placed quite a few here

              https://blog.engineyard.com/2011/useful-rewrites-for-nginx

              this is a basic redirect you can put the port or each port in place.

              server {
              server_name example.com;
              rewrite ^/(.*) https://example.com/$1 permanent;
              }

              USE THIS

              Redirect both, non-SSL and SSL to their www counterpart:

              <code>**server {
                  listen 80;
                  listen 443 ssl;
                  server_name directtraveller.com;
                  return 301 $scheme://www.directtraveller.com$request_uri;
              }**
              
              server {
                  listen 80;
                  listen 443 ssl;
                  server_name example.com;
                  # rest goes here...
              }</code> 
              

              Add a www with this block

              server {
              listen 80;

              listen 443 ssl;

              server_name directtraveller.com;
              rewrite ^(.*)$ $scheme://www.directtraveller.com$1;
              }

              (

              )

              Remove a www with this block instead

              server {
              listen 80;
              server_name www.directtraveller.com;
              rewrite ^(.*)$ $scheme://directtraveller.com$1;
              }

              <code>rewrite ^(.*)$ https://$host$1 permanent; #3
              rewrite ^ https://$host$request_uri permanent; #4
              
              I**f you have any questions please feel free to ask I hope this is enough information and not overwhelming. If you feel overwhelmed simply use the very first config.**
              
               **Sincerely,**
               **Tom**</code>
              
              TheWebMastercom 1 Reply Last reply Apr 11, 2015, 5:40 AM Reply Quote 0
              • TheWebMastercom
                TheWebMastercom last edited by Apr 10, 2015, 2:32 PM Apr 10, 2015, 2:32 PM

                What did you put to redirect the following:

                https://www.directtraveller.com/holidays/about-direct-traveller/british-travel-awards.asp
                to
                https://www.directtraveller.com/awards

                As that is where the problem lies.

                Direct_Ram 1 Reply Last reply Apr 11, 2015, 11:42 AM Reply Quote 0
                • Direct_Ram
                  Direct_Ram @TheWebMastercom last edited by Apr 10, 2015, 12:50 PM Apr 10, 2015, 12:50 PM

                  John threw that in and did a retest and is working now - you genius! Thanks

                  1 Reply Last reply Reply Quote 0
                  • RyanPurkey
                    RyanPurkey last edited by Apr 10, 2015, 11:32 AM Apr 10, 2015, 11:31 AM

                    Hi Ram. If Jon's fix above doesn't work, you might want to post the link(s) you're testing with Screaming Frog so that people here can see what's going on and give you specific recommendations. It sounds like there's a 302 in place on the http version of your site, but people will need details to see where exactly. Cheers!

                    1 Reply Last reply Reply Quote 1
                    • TheWebMastercom
                      TheWebMastercom last edited by Apr 10, 2015, 12:50 PM Apr 10, 2015, 11:24 AM

                      Try this in your .htaccess file:

                      RewriteCond %{HTTPS} off

                      First rewrite to HTTPS:

                      Don't put www. here. If it is already there it will be included, if not

                      the subsequent rule will catch it.

                      RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

                      Now, rewrite any request to the wrong domain to use www.

                      RewriteCond %{HTTP_HOST} !^www.
                      RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

                      Direct_Ram 1 Reply Last reply Apr 10, 2015, 12:50 PM Reply Quote 4
                      • 1 / 1
                      1 out of 10
                      • First post
                        1/10
                        Last post

                      Got a burning SEO question?

                      Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.


                      Start my free trial


                      Browse Questions

                      Explore more categories

                      • Moz Tools

                        Chat with the community about the Moz tools.

                      • SEO Tactics

                        Discuss the SEO process with fellow marketers

                      • Community

                        Discuss industry events, jobs, and news!

                      • Digital Marketing

                        Chat about tactics outside of SEO

                      • Research & Trends

                        Dive into research and trends in the search industry.

                      • Support

                        Connect on product support and feature requests.

                      • See all categories

                      Related Questions

                      • SimpleSearch

                        Getting indexed in Google Scholar

                        seo googlescholar

                        Hi all! We have a client who publishes scholarly research as a highly regarded non-profit. Their Publications aren't being indexed in Google Scholar 50% of the time and when they are, Google is pulling random stuff from a PDF vs. from the html page. Any advice on best practices is enormously appreciated

                        SERP Trends | Feb 17, 2024, 2:19 AM | SimpleSearch
                        1
                      • seoelevated

                        What do we know about the "Shops" SERP Feature?

                        serp features

                        I came across this SERP Feature in a search today on a mobile device. It does not show for the same search query on desktop. What do we know about this "Shops" SERP feature? shops-blur.jpg

                        SERP Trends | Nov 1, 2021, 6:19 PM | seoelevated
                        0
                      • vtmoz

                        Best proxy service to browse the Google from different countries to check the ranking

                        Hi Moz community, We need to check our website/pages rankings for random keywords at random timings in different countries. Beside checking in search console, we would like to check in browser. But Google now is not allowing us to browse the results of other country. I would like to use best proxy service to browse Google from different location to check how our pages are ranking & fluctuating. Please suggest on this. Thanks

                        SERP Trends | Feb 5, 2018, 12:13 PM | vtmoz
                        0
                      • vtmoz

                        Search results vary in chrome vs other browsers even in Incognito mode: Google's stand?

                        Hi all, We use incognito mode or private browsing to check the Actual results which are not impacted by previous history, location (sometimes), etc. Even we browse this way, we can see the different search results. Why would this happen? What's Google's stand on this? What is the actual way to browse to get the unbiased results for certain search queries? I have experienced that Chrome will rank our own websites bit higher compared to the other browsers even in incognito mode. Thanks

                        SERP Trends | Oct 30, 2017, 12:06 PM | vtmoz
                        1
                      • dkeipper

                        URL Parameter for Limiting Results

                        We have a category page that lists products. We have parameters and the default value is to limit the page to display 9 products. If the user wishes, they can view 15 products or 30 products on the same page. The parameter is ?limit=9 or ?limit=15 and so on. Google is recognizing this as duplicate meta tags and meta descriptions via HTML Suggestions. I have a couple questions. 1. What should be my goal? Is my goal to have Google crawl the page with 9 items or crawl the page with all items in the category? In Search Console, the first part of setting up a URL parameter says "Does this parameter change page content seen by the user?". In my opinion, I think the answer is Yes. Then, when I select how the parameter affects page content, I assume I'd choose Narrows because it's either narrowing or expanding the number of items displayed on the page. 2. When setting up my URL Parameters in Search Console, do I want to select Every URL or just let Googlebot decide? I'm torn because when I read about Every URL, it says this setting could result in Googlebot unnecessarily crawling duplicate content on your site (it's already doing that). When reading further, I begin to second guess the Narrowing option. Now I'm at a loss on what to do. Any advice or suggestions will be helpful! Thanks.

                        SERP Trends | May 30, 2017, 11:47 AM | dkeipper
                        0
                      • NortonSupportSEO

                        Ways to fetch search analytics - historical search query data from Google Search Console

                        Is there any way to fetch all historical search query data from Google Search Console ? Google allows us to view only 90 days report at the maximum. Does integrating google search console with google analytics tool solve this problem ?

                        SERP Trends | Jul 12, 2016, 11:30 AM | NortonSupportSEO
                        0
                      • Tormar

                        How create product category in Google Analytics?

                        Hi, I have a lot of product in my GA ecommerce. Does anyone how I can split my product by product categories in Analytics? E.g. Category: Blue cars, category: Yellow cars ...

                        SERP Trends | May 12, 2016, 3:19 PM | Tormar
                        0
                      • moneymm22

                        Create original content or Copy from several sources?

                        I own a site that that has about 15,000 pages that need some description content.  I plan to hire someone to retrieve or create content for each of these pages on my site. each page needs about 500 words. I was thinking that there is probably three ways i can go about this. If I hire someone cheap I can probably have them copy data from about 20 different sites. using about 5 sources for each page description. I can hire someone that has some experience writing english content, and have them go to a few sites and then in their own words summarize the description on my site. I can hire a great content writer, have them do research on each page, and create completely unique content. I probably will do some combination of these 3 things. (great content writer on a few pages, since thats all i can afford to do) and the rest do the cheaper route. Is copying sentences from multiple sources a good idea? or does the content really need to be original?

                        SERP Trends | May 8, 2016, 10:38 PM | moneymm22
                        0

                      Get started with Moz Pro!

                      Unlock the power of advanced SEO tools and data-driven insights.

                      Start my free trial
                      Products
                      • Moz Pro
                      • Moz Local
                      • Moz API
                      • Moz Data
                      • STAT
                      • Product Updates
                      Moz Solutions
                      • SMB Solutions
                      • Agency Solutions
                      • Enterprise Solutions
                      Free SEO Tools
                      • Domain Authority Checker
                      • Link Explorer
                      • Keyword Explorer
                      • Competitive Research
                      • Brand Authority Checker
                      • Local Citation Checker
                      • MozBar Extension
                      • MozCast
                      Resources
                      • Blog
                      • SEO Learning Center
                      • Help Hub
                      • Beginner's Guide to SEO
                      • How-to Guides
                      • Moz Academy
                      • API Docs
                      About Moz
                      • About
                      • Team
                      • Careers
                      • Contact
                      Why Moz
                      • Case Studies
                      • Testimonials
                      Get Involved
                      • Become an Affiliate
                      • MozCon
                      • Webinars
                      • Practical Marketer Series
                      • MozPod
                      Connect with us

                      Contact the Help team

                      Join our newsletter
                      Moz logo
                      © 2021 - 2025 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
                      • Accessibility
                      • Terms of Use
                      • Privacy

                      Looks like your connection to Moz was lost, please wait while we try to reconnect.