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. On Page 301 redirect for html pages

    On Page 301 redirect for html pages

    Technical SEO Issues
    7 6 1.6k
    • 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.
    • shupester
      shupester last edited by

      For php pages youve got

      Header( "HTTP/1.1 301 Moved Permanently" );
      Header( "Location: http://www.example.com" );
      ?>

      Is there anything for html pages? Other then

      Or is placing this code redirect 301 /old/old.htm http://www.you.com/new.php in the .htaccess the only way to properly 301 redirect html pages?

      Thanks!

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

        This post is deleted!
        MarloSchneider 1 Reply Last reply Reply Quote 0
        • eyepaq
          eyepaq last edited by

          My vote gose to the htaccess any time all the time.

          It's global, you can add all the rewrite rules within the same global file.

          Is just my opinion.

          randfish 1 Reply Last reply Reply Quote 1
          • MarloSchneider
            MarloSchneider @Guest last edited by

            Just make sure not to use this for a whole ton of 301 redirects.  If it is a big enough redirect project using PHP might be the way to go.

            shupester 1 Reply Last reply Reply Quote 0
            • shupester
              shupester @MarloSchneider last edited by

              I have a lot (100+) of 301 redirects to do for .html pages, is the .htaccess the only way to go?

              Thanks

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

                I am suprised no one is recommending using the httpd.conf file. It functions the same as the.htaccess file except it is much more efficient because it is loaded into the servers memory which means the file is opened & read once. With an .htaccess file the server reads the file on every request.

                Also, if PHP is enabled on the server you can use php code in html pages. There is a php or server setting where you can say read html pages as php.

                1 Reply Last reply Reply Quote 0
                • randfish
                  randfish @eyepaq last edited by

                  Yeah - htaccess is the way to go for rewrite rules. Check out http://www.seomoz.org/learn-seo/redirection for more depth/detail, too.

                  1 Reply Last reply Reply Quote 0
                  • 1 / 1
                  • First post
                    Last post
                  • Page for page 301 redirects from old server to new server
                    cindyt-17038
                    cindyt-17038
                    0
                    5
                    398

                  • If I want clean up my URLs and take the "www.site.com/page.html" and make it "www.site.com/page" do I need a redirect?
                    Booj
                    Booj
                    0
                    4
                    113

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

                  • 301 redirect all 404 pages
                    alsvik
                    alsvik
                    0
                    8
                    3.6k

                  • How does this rank? - a page that is 301 redirected
                    Morris77
                    Morris77
                    0
                    5
                    279

                  • Can you 301 redirect a page to an already existing/old page ?
                    Bryan_Loconto
                    Bryan_Loconto
                    0
                    3
                    262

                  • Delete 301 redirected pages from server after redirect is in place?
                    RuthBurrReedy
                    RuthBurrReedy
                    0
                    5
                    4.0k

                  • 301 redirecting some pages directly, and the rest to a single page
                    danrawk
                    danrawk
                    0
                    3
                    703

                  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