Results 1 to 9 of 9
  1. #1
    ...and a Pirate's heart. Convergence's Avatar
    Join Date
    June 24th, 2005
    Posts
    6,918
    .htaccess question
    I recently gutted a site and started over - I have tons of URLs indexed that no longer exist.

    My question is -

    "How do I redirect all these outdated / non-existing URLs to the main page of the site using .htaccess"?

    Thanks!

    ~ Denis
    Salty kisses, Sandy toes, and a Pirate's heart...

  2. #2
    ABW Ambassador
    Join Date
    January 18th, 2005
    Location
    England
    Posts
    4,327
    have a 301 redirect to redirect all of the pages that no longer exist on the server to wherever you want them to go

  3. #3
    Believe knight01's Avatar
    Join Date
    August 14th, 2006
    Location
    Dayton, Ohio
    Posts
    1,815
    But you don't necessarily want to re-direct them to your home page or any content page. This would likely get that page penalized with a dup content penalty as big G thinks there are multiple urls with the same content on them.
    Someday starts today
    Military Discounts

  4. #4
    ...and a Pirate's heart. Convergence's Avatar
    Join Date
    June 24th, 2005
    Posts
    6,918
    Quote Originally Posted by knight01
    But you don't necessarily want to re-direct them to your home page or any content page. This would likely get that page penalized with a dup content penalty as big G thinks there are multiple urls with the same content on them.
    D'oh!!! Good point - don't know what I was thinking - I'll just use a custom 404 page.

    Thanks!
    Salty kisses, Sandy toes, and a Pirate's heart...

  5. #5
    ABW Ambassador ladidah's Avatar
    Join Date
    October 15th, 2007
    Location
    MA
    Posts
    1,888
    I don't understand, there can't be a dupe content flag because the page simply doesn't exist anymore. A 301 means "this page does not exist anymore", and with a redirect, it just says, "look here instead".

    With a 301 you (1) preserve any link juice you get from links (2) your peeps can still find you from their bookmarks and not be dissappointed with a 404.

  6. #6
    ABW Ambassador Doug247's Avatar
    Join Date
    January 18th, 2005
    Location
    DE USA
    Posts
    931
    Why not just use a well thought 404.htm?
    Thanks,
    Doug

  7. #7
    ...and a Pirate's heart. Convergence's Avatar
    Join Date
    June 24th, 2005
    Posts
    6,918
    Quote Originally Posted by itsupportnotes
    Why not just use a well thought 404.htm?
    Is what I ended up doing - thanks all!
    Salty kisses, Sandy toes, and a Pirate's heart...

  8. #8
    Moderator BurgerBoy's Avatar
    Join Date
    January 18th, 2005
    Location
    jacked by sylon www.sylonddos.weebly.com
    Posts
    9,618
    All you have to do is put this in you .htaccess file:
    Code:
    ErrorDocument 404 http://www.YourIndexPage.com/
    Every page that no longer exist will automatically redirect to your home page.

  9. #9
    ...and a Pirate's heart. Convergence's Avatar
    Join Date
    June 24th, 2005
    Posts
    6,918
    Quote Originally Posted by BurgerBoy
    All you have to do is put this in you .htaccess file:
    Code:
    ErrorDocument 404 http://www.YourIndexPage.com/
    Every page that no longer exist will automatically redirect to your home page.
    I did the following...

    Code:
    ErrorDocument 404 /notfound.php
    And made notfound.php a very nice "error" page.
    Salty kisses, Sandy toes, and a Pirate's heart...

  10. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. .htaccess question
    By DealSucker in forum Programming / Datafeeds / Tools
    Replies: 1
    Last Post: November 7th, 2012, 03:50 PM
  2. 301 redirect using htaccess question
    By ~Michelle in forum Midnight Cafe'
    Replies: 5
    Last Post: February 26th, 2006, 09:16 PM
  3. .htaccess question
    By Wayder in forum Programming / Datafeeds / Tools
    Replies: 4
    Last Post: December 20th, 2005, 04:24 PM
  4. mod_rewrite/.htaccess question
    By dak142 in forum Midnight Cafe'
    Replies: 6
    Last Post: July 19th, 2004, 03:19 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •