Skip to:
Content
Pages
Categories
Search
Top
Bottom

Best Way to do a 301 Redirect

  • I have some pages that I have to do 301 redirects on and just wondering what the best way to do this is? Also some of the pages are ones that I have deleted but google still has indexed what do I do about those ones? Just redirect to my home page. I have heard that htaccess us the best way to do it, I have never done it before but it didn’t sound very difficult. I also read there are plugins for this but are they as effective as doing it manually?

    Any help would be much appreciated!

Viewing 8 replies - 1 through 8 (of 8 total)

  • aces
    Participant

    @aces

    For a few individual pages you could just add redirect rules, a line per rule, to your .htaccess file – something like:

    `
    Redirect 301 /oldpage/ http://domain.com/newpage/
    `

    The old page address is from the site root (the same as the htaccess file) the new address has to be from http://

    The following discussion might be useful http://wordpress.stackexchange.com/questions/8665/how-to-301-redirect-category-to-customname

    Thanks for the reply aces! Does it matter where I put the code? Just at the very end? And what should I do about the pages that I’ve deleted but google still has them indexed, how do I get google to know those pages are deleted now?


    aces
    Participant

    @aces

    Before editing it would be a good idea to make a copy of the original .htaccess file in case something goes wrong…..

    The single line(s) can go on their own individual lines. At the end of the file should be fine, just don’t break up connected sets of lines like the permalinks settings.

    301 is a ‘Permanently Moved’ redirect (there are others include temp redirect) – google (and others) crawling your site should know what it means…..

    Unless you have problems with the htaccess file, there is no reason to remove the lines from htaccess, so anybody who comes across them in future should also be seamlessly redirected…

    It can take a surprisingly long time until google is fully updated.

    Perfect, so I figured out how to set up the redirects. Many of the pages that google couldn’t find though and gave a 404 error for were pages that I deleted. What do I do with those pages? Do I just redirect them to my home page since the post itself simply doesn’t exist anymore or do I just leave them at 404’s? Or does it even matter.

    Thanks for your help Aces, much appreciated!


    aces
    Participant

    @aces

    I don’t know of anything specific you can do about completely deleted pages. I try to avoid them.

    Having a google sitemap.xml file might help. I use: https://wordpress.org/extend/plugins/google-sitemap-generator/ but there are others…..

    Yeah, definitely going to avoid them from now on. I use buddypress so I don’t think that sitemap generator works with buddypress and I can’t seem to find a good buddypress sitemap generator. Do you happen to know of any? Would just using the google sitemap generator be better than nothing? I don’t think it would link to any of my buddypress pages though.


    aces
    Participant

    @aces

    I use it with buddypress…. Since bp 1.5 the main buddypress pages show up with the plugin default settings and you can add extra pages on the settings page…

    There might be a better plugin (or even theme…) to handle buddypress sitemap.xml files out there though….

    Ooooh, thanks for the tip! and all the help you have provided me here. Much appreciated! Thanks aces. Going to give that sitemap generator a shot.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Best Way to do a 301 Redirect’ is closed to new replies.
Skip to toolbar