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. On-Page / Site Optimization
    4. How do I do a 301 Redirect in Wordpress

    How do I do a 301 Redirect in Wordpress

    On-Page / Site Optimization
    4 4 716
    • 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.
    • SteveSweat
      SteveSweat last edited by

      I have several pages that are showing up as "duplicate" on my Wordpress based site based upon the structure of site.  I was wondering how to do a 301 redirect for these pages

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

        I would do it with a .htaccess file. If your hosting company has cPanel (or any other good website management software) you can do this with a gui and type the old link and the link in to your browser and hit save, or you can do it manually by creating (or editing) the .htaccess file in the root of your directory. Super fast and secure way of doing it, although you do need to be running apache (et al) not IIS.

        This site has some good info on it

        http://www.josiahcole.com/2007/07/11/almost-perfect-htaccess-file-for-wordpress-blogs/

        As with all things there are a few ways of doing it. This seems to cover most of the exploits that .htaccess files are good at blocking including the 301 redirects.

        Bear in mind that .htaccess 301s using CONDITIONS are regex and certain rules apply such as escaping characters.

        so this doesnt need escaping and is simple

        #redirect old to new
        Redirect 301 /old.php http://www.yourdomain.com/new.php

        but this does, see the . at the end of digg.com is digg.com

        #block referring domains
        RewriteEngine on
        RewriteCond %{HTTP_REFERER} digg.com [NC]
        RewriteRule .* – [F]

        Once you have your 301s in place check the header return to see if its working by using a simple service like this

        http://www.checkmyheaders.com/index.php

        Hope it works 🙂

        Adam

        1 Reply Last reply Reply Quote 1
        • ContactOnline
          ContactOnline last edited by

          Hi Steven,

          I agree with Adam that editing the .htaccess file directly is the best way to do this, however in the interest of you not having that knowledge there are plenty of wordpress plugins that allow you to do 301 redirects either on the fly or a way that's easier to do.

          Here is a link to a search on the wordpress site http://wordpress.org/extend/plugins/search.php?q=301+redirect

          My preference generally is to actually search for the plugins within the Wordpress Admin panel in the menu plugins, then go to add new and type in 301 redirect in the search.From there you'll be able to see a large list along with descriptions and reviews that will help you to narrow down what plugin may suit you.

          It also makes the installation process easier as you don't have to do the whole download then upload stuff it just downloads directly to your Wordpress installs and you then just have to activate it and in some plugins cases change some settings.

          Word of warning though doing 301s should be really thought through before you do them as it makes it permanent so just double check you have the right URLs before you commit them. A client of mine made a huge mistake that took a while to sort out.

          Also something to look at and that's plugins like SEO Yoast as that can allow you to use canonical names, which could help with some types of duplicate pages and for some pages that show up in SEOmoz's campaign reports that you don't want or need showing up. I won't go into more detail as that's not what you were asking, but I figured it's related somewhat so point you in the right direction just in case 😉

          Hope that all helps.

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

            Hi Steven,

            Alan's suggestion of installing the Wordpress SEO by Yoast plugin is right on target.

            This plugin allows you to create a 301 redirect for any post and also to add the canonical link element if you prefer (only for single pages and posts).

            With the plugin installed, to add a 301 redirect, just click the Advanced tab and scroll to the bottom. Enter the URL you wish to redirect the post or page to and click Update. Obviously, the plugin writes the .htaccess rule for you, but if you do want to edit the .htaccess file directly, the Yoast plugin also allows you to do this.

            This plugin also includes a number of other features that allow you to deal with some of the technical shortcomings of Wordpress from an SEO point of view (duplicate content issues etc), so adds a lot of value.

            Hope that helps,

            Sha

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            • First post
              Last post
            • 301 Redirect to external site
              RameshNair
              RameshNair
              0
              5
              1.2k

            • 301 twice redirect (no negative)
              Christy-Correll
              Christy-Correll
              0
              4
              227

            • Massive 301 Permanant Redirects
              Dr-Pete
              Dr-Pete
              0
              4
              1.4k

            • Redoing a site - 404 redirect or 301 redirect
              danatanseo
              danatanseo
              0
              3
              536

            • 301 redirect usage
              intSchools
              intSchools
              0
              5
              369

            • 301 redirect -
              aidanlawlor
              aidanlawlor
              0
              4
              324

            • 301 redirect link
              AUSOM
              AUSOM
              0
              4
              583

            • How do I do a 301 Redirect in IIS 7 from http://www.freightmonster.com/index.html to http://freightmonster.com/index.html when I don't have a physical page to redirect?
              EricaMcGillivray
              EricaMcGillivray
              0
              4
              1.0k

            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