1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Help - Forwarding invalid url's

Discussion in 'Black Hat SEO' started by moneymachine01, Apr 8, 2011.

  1. moneymachine01

    moneymachine01 Regular Member

    Joined:
    Sep 2, 2009
    Messages:
    339
    Likes Received:
    75
    I would like to forward any invalid url's on my site to my home page. Is there a way to do this ? This way users will get forwarded to my home page rather than getting a 404 error. Thx
     
  2. Crazy

    Crazy Jr. Executive VIP

    Joined:
    Jun 13, 2009
    Messages:
    640
    Likes Received:
    319
    Occupation:
    VB, C#, XHTML, CSS, PHP, MySQL, JavaScript, jQuery
    Location:
    Everywhere
    Yes, modify your htaccess file with the following:

    ErrorDocument 404 /index.php
     
  3. DebtFreeMe

    DebtFreeMe Regular Member

    Joined:
    Mar 14, 2010
    Messages:
    418
    Likes Received:
    363
    Occupation:
    Military
    Location:
    Earth
    If you want to redirect all your 404 errors to a particular page, then I think you add the following line to your .htaccess file

    ErrorDocument 404 /errorpage.htm

    You can make errorpage.htm any page you want, including your home page.

    hope that helps.
     
    • Thanks Thanks x 1
  4. moneymachine01

    moneymachine01 Regular Member

    Joined:
    Sep 2, 2009
    Messages:
    339
    Likes Received:
    75
    Ok, does the .htaccess need to be located in the specific domains folder or are you talking about the one in Public_html folder ? Thx
     
  5. Crazy

    Crazy Jr. Executive VIP

    Joined:
    Jun 13, 2009
    Messages:
    640
    Likes Received:
    319
    Occupation:
    VB, C#, XHTML, CSS, PHP, MySQL, JavaScript, jQuery
    Location:
    Everywhere
    If you have add-on domains and you're trying to manage 404 errors for that add-on domain, then put it in that domains folder. Wherever you have your index file will almost always be your root directory, and that's where you should have your .htaccess file.
     
    • Thanks Thanks x 1
  6. moneymachine01

    moneymachine01 Regular Member

    Joined:
    Sep 2, 2009
    Messages:
    339
    Likes Received:
    75
    Thanks, worked like a charm! +1 rep for both of you. :-o
     
    • Thanks Thanks x 2
  7. Crazy

    Crazy Jr. Executive VIP

    Joined:
    Jun 13, 2009
    Messages:
    640
    Likes Received:
    319
    Occupation:
    VB, C#, XHTML, CSS, PHP, MySQL, JavaScript, jQuery
    Location:
    Everywhere
    No problem bud.
     
  8. DebtFreeMe

    DebtFreeMe Regular Member

    Joined:
    Mar 14, 2010
    Messages:
    418
    Likes Received:
    363
    Occupation:
    Military
    Location:
    Earth
    Glad it helped, that's what this site is for.