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. Other Research Tools
    4. Calling all 301 htaccess Guru's - www to non www - then to https + Redirect homepage to inner page

    Calling all 301 htaccess Guru's - www to non www - then to https + Redirect homepage to inner page

    Other Research Tools
    7 2 215
    • 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.
    • Jes-Extender-Australia
      Jes-Extender-Australia last edited by

      I have tried searching, multiple opinions and multiple things that supposedly work.

      What I have now, seems to work from an end user perspective, but Roger tells me otherwise: Redirect Chain issue....redirect, which redirects which redirects etc.....

      FIRST, we need to redirect all www to non www.

      SECOND, we need to redirect all to https.

      THIRD, we need to redirect the homepage to an inner page. (Got to love BOGUS DMCA complaints! :)?)

      So far we have:

      RewriteEngine on
      RewriteCond %{HTTPS} off
      RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
      RewriteCond %{HTTP_HOST} ^mydomain.com.au$ [OR]
      RewriteCond %{HTTP_HOST} ^www.mydomain.com.au$
      RewriteRule ^/?$ "https://mydomain.com.au/inner-page-here" [R=301,L]

      Plus down the page there is the usual wordpress settings:

      <ifmodule mod_rewrite.c="">RewriteEngine On
      RewriteBase /
      RewriteRule ^index.php$ - [L]
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule . /index.php [L]</ifmodule>

      So, why does it seem to work for the end user, but Roger has his knickers in a knot saying, redirect, to redirect to redirect etc?

      Namaste and many thank you's in advance 🙂

      1 Reply Last reply Reply Quote 0
      • eli.myers
        eli.myers last edited by

        Hey!

        Thanks for reaching out to us!

        When we point out a redirect chain, the idea is to reduce the number of redirects in total.

        Let's say you had three URLs - URL A, B and C. URL A redirects to URL B, which redirects again to URL C. You'd want to remove the redirects for URL B in the middle, so that URL redirects straight to URL C.

        I've had a look at your Campaign and one of the redirect chain's we are flagging up: https://www.screencast.com/t/kHnwGBcdvb (I used a third party tool - https://httpstatus.io/ ) - As you can see there are 3 redirects in place, would it be possible to cut it down to just one redirect? This minimises moving parts and would fix that redirect chain.

        Of course, it's best to check with your website administrator that this is the best move in your case, as each site is completely different.

        Unfortunately I am not a web developer so cannot advise on the code within your page, just the tools we provide 🙂

        Feel free to write in to help@moz.com if you would like to follow up with any specific questions!

        Thanks!

        Eli

        Jes-Extender-Australia 1 Reply Last reply Reply Quote 1
        • Jes-Extender-Australia
          Jes-Extender-Australia last edited by

          Found this, but I do not know if both portions need to be added or one....any thoughts?

          To redirect www to non-www

          RewriteCond %{HTTP_HOST} ^www.your_domain.com$
          RewriteRule ^(.*)$ http://your_domain.com/$1 [R=301]

          To redirect www to non-www (while using SSL)

          RewriteCond %{HTTP_HOST} ^www.your_domain.com$
          RewriteCond %{SERVER_PORT} ^443
          RewriteRule ^(.*)$ https://your_domain.com/$1 [R=301]

          So... would both be needed, and what would the additional part be to redirect home to an inner page?

          Thank you in advance!

          eli.myers 1 Reply Last reply Reply Quote 0
          • eli.myers
            eli.myers @Jes-Extender-Australia last edited by

            I would normally advise that you speak to a web developer for a question like this. Perhaps something else on the forum who reads this question will be able to advise?

            Unfortunately I am not able to help out with the code in this situation, sorry about that!

            Eli

            Jes-Extender-Australia 1 Reply Last reply Reply Quote 1
            • Jes-Extender-Australia
              Jes-Extender-Australia @eli.myers last edited by

              Hi Eli,

              Thank you for your response.

              You actually pointed out a specific redirect that was in place, but what we were redirecting didn't exist i.e 301 redirect /tag/ThisExists-ButThisTypoDoesnt - do you think that would be the cause? Although, if the tag/post didn't exist how did Roger pick it up, through htaccess?

              We are in the process of redirecting our /tag and /category posts to more appropriate pages. I will re-crawl and see if the same issue pops up fingers crossed.

              1 Reply Last reply Reply Quote 1
              • Jes-Extender-Australia
                Jes-Extender-Australia @eli.myers last edited by

                All good, thanks for your help 🙂

                Just realised too, we have put a plugin in place to redirect all 404's to a sitemap page....probably the 3 step redirect issue Moz is picking up on....got to love this stuff. Always keeps you on your toes.

                eli.myers 1 Reply Last reply Reply Quote 0
                • eli.myers
                  eli.myers @Jes-Extender-Australia last edited by

                  Haha it certainly does! Thanks for keeping me updated 🙂

                  1 Reply Last reply Reply Quote 0
                  • 1 / 1
                  • First post
                    Last post
                  • Moz bot has trouble crawling Angular JS - I believe it's seeing the SPA (Single Page Application) before Universal. Anyone else have this issue? What is the fix?
                    dave.kudera
                    dave.kudera
                    1
                    2
                    38

                  • How do I disallow crawl on a directory when it's a prefix to my site's URL?
                    tawnycase
                    tawnycase
                    0
                    3
                    88

                  • Www and non www / duplicate content / redirects / www resolve issue
                    Maslavista
                    Maslavista
                    0
                    7
                    852

                  • How does a non-traditional TLD impact Moz's crawl test?
                    ThinkAOR
                    ThinkAOR
                    1
                    3
                    145

                  • I am doing the On-page SEO for a website that's never had any SEO done before. I will start with the Pages. Is it necessary to do SEO/Keywords for older Posts?
                    evolvingSEO
                    evolvingSEO
                    0
                    5
                    187

                  • Should I be getting an 'A' Grade for basic words in a page title?
                    David-Kley
                    David-Kley
                    0
                    2
                    69

                  • Is it normal for my homepage's page authority to be higher than my domain authority?
                    Saijo.George
                    Saijo.George
                    0
                    2
                    825

                  • How can the Moz Page Grader support a 'keyword portfolio' approach?
                    Cyrus-Shepard
                    Cyrus-Shepard
                    0
                    3
                    151

                  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