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. .htaccess Redirect 301 issues

    .htaccess Redirect 301 issues

    Technical SEO Issues
    5 3 140
    • 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.
    • Cyberace
      Cyberace last edited by

      I have completely rewritten my web site, adding structure to the file directories. Subsequently added was Redirect information within the .htaccess file.

      The following example ...
      Redirect 301 /armaflex.html http://www.just-insulation.com/002-brands/armaflex.html
      Returns this response in the URL bar of ... 
      http://www.just-insulation.com/002-brands/armaflex.html?file=armaflex
      I am at a loss to understand why the suffix "?file=armaflex" is added

      The following code is inserted at the top of the file ...
      RewriteEngine On

      redirect html pages to the root domain

      RewriteRule ^index.html$ / [NC,R,L]

      Force www. prefix in URLs and redirect non-www to www

      RewriteCond %{http_host} ^just-insulation.com [NC]
      RewriteRule ^(.*)$ http://www.just-insulation.com/ [R=301,NC]

      Any advice would be most welcome.

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

        I think there's a problem with the Redirect and RewriteRule functions clashing. Try changing your redirects to RewriteRule. Let me know if this works.

        RewriteRule ^armaflex.html$ http://www.just-insulation.com/002-brands/armaflex.html [R=301,NC]

        Cyberace 1 Reply Last reply Reply Quote 0
        • Cyberace
          Cyberace @StreamlineMetrics last edited by

          Thank you for your kind advice. Unfortunately, the result remains the same ...
          http://www.just-insulation.com/002-brands/armaflex.html?file=armaflex

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

            What happens when you remove all of your other rules and just have the 301 redirect?

            Cyberace 1 Reply Last reply Reply Quote 0
            • Cyberace
              Cyberace @OlegKorneitchouk last edited by

              Thanks for the suggestion.

              The issue appears to derive from the fact that our web pages are published with .tpl (template) extensions, which are rewritten via PHP to include pricing information, then presented to the browser with an .html extension.

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post
              • Where to put 301 redirects in my Wordpress htaccess file?
                Benspain
                Benspain
                0
                3
                34

              • 301 redirect syntax for htaccess
                IOHanna
                IOHanna
                1
                3
                6.0k

              • Help creating a 301 redirect in my htaccess file
                Felip3
                Felip3
                0
                4
                108

              • Htaccess code to 301 redirect a folder change
                Paul_MC
                Paul_MC
                0
                4
                160

              • Need Help writing 301 redirects in .htaccess file
                Dr-Pete
                Dr-Pete
                0
                5
                1.3k

              • Help needed please with 301 redirects in htaccess file.
                petersommertravels
                petersommertravels
                0
                9
                2.3k

              • 301 redirect Issues
                stefanok
                stefanok
                0
                4
                881

              • 301 Redirect Issue
                EntrustSEO
                EntrustSEO
                0
                7
                987

              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