The Moz Q&A Forum

    • Forum
    • Questions
    • My Q&A
    • Users
    • Ask the Community

    Welcome to the Q&A Forum

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

    1. SEO and Digital Marketing Q&A Forum
    2. Categories
    3. Technical SEO Issues
    4. Avoid landing page redirects

    Avoid landing page redirects

    Technical SEO Issues
    6 3 175
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as question
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Sammyh
      Sammyh last edited by

      Avoid landing page redirects for the following chain of redirected URLs.

      • http://domainname.com/
      • https://domainname.com/
      • https://www.domainname.com/

      Anyone know how to solve this issue the correct way?

      1 Reply Last reply Reply Quote 0
      • Keszi
        Keszi last edited by

        Hi Sammy,

        If I understand your question, you need help with htaccess code to force both https and www with same rule? If so, this might be what you are looking for:

        RewriteEngine On
        RewriteCond %{HTTPS} off [OR]
        RewriteCond %{HTTP_HOST} !^www.domainname.com$ [NC]
        RewriteRule ^(.*)$ https://www.domainname.com/$1 [L,R=301]

        HashtagHustler Sammyh 3 Replies Last reply Reply Quote 1
        • HashtagHustler
          HashtagHustler @Keszi last edited by

          Agreed! Forcing the rewrite will solve the problem, I'm guessing OP is currently using 301 redirects to send people to HTTPS.

          1 Reply Last reply Reply Quote 0
          • Sammyh
            Sammyh @Keszi last edited by

            Thanks Istvan.

            Where would I place this code?

            1 Reply Last reply Reply Quote 0
            • Sammyh
              Sammyh @Keszi last edited by

              We are using IIS as a web server, not Apache.

              1 Reply Last reply Reply Quote 0
              • Keszi
                Keszi last edited by

                Oh, sorry. Somehow I didn't get any notification on your reply.

                For IIS you could go with web.config of your website. The code will be something like:

                <rule name="Force WWW and SSL" enabled="true" stopprocessing="true"><match url="(.*)"><conditions logicalgrouping="MatchAny"><add input="{HTTP_HOST}" pattern="^[^www]"><add input="{HTTPS}" pattern="off"></add></add></conditions>
                <action type="Redirect" url="https://www.domainname.com/{R:1}" appendquerystring="true" redirecttype="Permanent"></action></match></rule>

                1 Reply Last reply Reply Quote 1
                • 1 / 1
                • First post
                  Last post
                • Use Internal Search pages as Landing Pages?
                  sajadf76df6t
                  sajadf76df6t
                  0
                  7
                  60

                • Is it good to redirect million of pages on a single page?
                  EricaMcGillivray
                  EricaMcGillivray
                  0
                  8
                  193

                • Advice on whether we 301 redirect a page or update existing page?
                  tomwhite
                  tomwhite
                  0
                  2
                  83

                • After I 301 redirect duplicate pages to my rel=canonical page, do I need to add any tags or code to the non canonical pages?
                  Mike.Goracke
                  Mike.Goracke
                  0
                  2
                  125

                • How do I 301 redirect a number of pages to one page
                  AndersS
                  AndersS
                  0
                  5
                  404

                • When Is It Good To Redirect Pages on Your Site to Another Page?
                  aroach
                  aroach
                  1
                  3
                  289

                • Is it better to delete web pages that I don't want anymore or should I 301 redirect all of the pages I delete to the homepage or another live page?
                  EGOL
                  EGOL
                  0
                  2
                  417

                • 301 redirecting landing page errors
                  ShaMenz
                  ShaMenz
                  0
                  3
                  563

                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
                • Digital Marketers
                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 - 2026 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
                • Accessibility
                • Terms of Use
                • Privacy