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
                  • 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

                  • 301 redirects - one overall redirect or an individual one for each page url
                    Kurt_Steinbrueck
                    Kurt_Steinbrueck
                    1
                    4
                    160

                  • Redirect a 301 Redirect
                    RedCaffeine
                    RedCaffeine
                    0
                    5
                    98

                  • 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 to know what pages are 301 redirecting to me?
                    riyas_
                    riyas_
                    0
                    2
                    208

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

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

                  • 301 Redirect From Dynamic Page To Static
                    TheDude
                    TheDude
                    1
                    3
                    512

                  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