URL forwarding issue.

Discussion in 'Web Design and Development' started by definitive, Jan 27, 2011.

  1. definitive macrumors 68000

    definitive

    Joined:
    Aug 4, 2008
    #1
    I used to have a WordPress-based website with a certain URL structure. Recently I completely redid the site, and wiped the old site's contents and settings. Now I keep getting hits from search engine bots to old URL's. Is there a way to fix this (even through some WP plugin) so they'd stop visiting outdated links that don't exist anymore? I have a 404 page, but I don't know if that is of any help.
     
  2. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #2
    I generally use the .htaccess file to setup rules to forward requests to new destinations.

    Two different types of redirects:
    Code:
    # If you use to have folder "old" that has its contents at the root level, this will redirect them
    RewriteRule ^old/?(.*) /$1 [R=301,L]
    
    <IfModule mod_alias.c>
      Redirect permanent /old.php http://www.fakedomain.com/new.php
    </IfModule>
    If you provide examples of the format of the old and new I might be able to give more precise help. Doing redirects successfully is a bit of an art.
     
  3. definitive thread starter macrumors 68000

    definitive

    Joined:
    Aug 4, 2008
    #3
    the issue is that i've deleted the old site's content. it had a structure where it had website.com/post-title, and the new one is the same way. only difference is that the content of the old site has been wiped completely (i had no use for it), and started using new content. the thing is that search engines have been visiting the old content's links. i've uploaded new sitemap.xml file to root and google's webmaster tools, but i don't know if that will help sort out the issue or not. i read something about 301 or 302 redirecting pages, but that left me confused as i don't know if it relates to my issue or not.
     
  4. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #4
    I gotcha, I thought stuff had just moved, but it sounds like it just no longer exists. The new sitemap should help search engines eventually figure things out. Another thing to help visitors is by creating a custom 404 error page where you can provide the look of your site and give links to your new blog page and maybe provide message saying the site went through a reorganization and sorry for the confusion. If you wanted to get really fancy you could parse the link they tried to get to and use the parsed words to search your site and provide links to pages on your site that may relate to what they are looking for. That's a bit of work though.

    Custom .htaccess page can be setup from the .htaccess file:
    Code:
    ErrorDocument 404 /error404.php
    Then just create a file named "error404.php" (or whatever you want to name it with) and place it in the root directory. If there's common pages that people trying to access you may use the redirect ideas from my post before to establish special cases for them and redirect those to specific pages.
     

Share This Page