Using d6 I am trying to make it so that sites linking to an older page on our site automatically are shown the front page. I found some old threads on it and 2 modules which I just tried: Custom Error and
http://drupal.org/project/blocks404

Using custom error, I was able to get it to show the front page by configuring the 403/404 errors in Error Reporting to point to my home page view "front". however the blocks dont show and I use a hard coded logic test in the theme to see if the front page is displaying which I use to show a webcam area. Since its showing the front page 'content' without forwarding them to the actual front page, this code is failing to show our webcam, the main draw to our front page.

I would like all 404 errors to redirect directly to the front page. So that if you visit domain .com/oldpage it would do a 301 redirect to the root domain .com home page.

What is a good way to do this?

Comments

hershel’s picture

lomo’s picture

I like Search404 since it most often *does* bring you to the intended page (or a link to it, anyway). Redirecting all 404s to the home page is simple enough, but it might be confusing or frustrating to your visitors.

http://drupal.org/project/search404

See you at the Drupalcon!

mcsolas’s picture

Search404 looks very interesting, thank you.

Also I realize that I might just hack a few lines into the htaccess file and handle one particular url I need to deal with.

* I found the first link mentioned searching at the bottom was the 2 modules I tried and didnt get to work. the block module didn't solve my problem which I realize is because is hard coded as an if statement in the page template. I need to redirect to the "domain.com/" home page to have my code work properly, thus why I thought about just doing it via htaccess. I could not figure out how to make the customerror module do that.

ayesh’s picture

If you are doing such redirects to home page or a relevant page, make sure you send a http 404 response to us and human visitors. If you don't, we will steps to lower your ranking from my and my fello search engines' indexes.

Thank you.
Sincerely,
Googlebot (head of Internatioan search bit foundation).

mcsolas’s picture

I am still not sure how to solve this one. I tried manually adding in a 301 redirect to the htaccess file and it seems to have disabled drupal from loading. Since its just a single url in question, I thought that might work.

The modules I tried left out the blocks on the right side. I just want people going to this old url, they are looking for a webcam which is on the front page. They will be happy if it redirects them to the page this is currently on since thats what they are looking for specifically in this case.

Stumped.. not sure what to do. Any ideas welcome!

lomo’s picture

Sounds like you really could use the "Path redirect" module.

See you at the Drupalcon!

mcsolas’s picture

Works perfectly. Thank you so much for pointing me in the right direction!

lomo’s picture

Glad you've got that sorted out. :-)

See you at the Drupalcon!