By Sykoi on
The subject describes it pretty well. I recently installed Drupal on a domain and took out all of the old (Manually created) .htm, .html and .php files, and want all of the old URLs (In google indexes) to be forwarded to the front page en masse (As in, not having to do each one manually because there are a ton).
Any ideas?
Comments
My suggestion:
My suggestion: http://drupal.org/project/search404
-----------------
Vindstille.net | Gravide studenter mer friske enn andre gravide?
Sadly that won't work, most
Sadly that won't work, most URLs are combined shortened words and after installing it, not a single old-url I tested returned any results.
If you go to
If you go to /admin/settings/error-reporting you can change the errorpage.
-----------------
Vindstille.net | Gravide studenter mer friske enn andre gravide?
hi try these steps
this technique... i have used for access denied error hope it will works for you after some changes
1) Create a node of type page. You must have the PHP input filter enabled.
2) In body section insert
3) Submit the node (you should see the "Access Denied: You do not have access to this page." message
4) Remember this node's ID number
5) Goto admin/settings
6) # In the section about alternate 403 error pages, insert "node/XXXX" where XXX is your node's ID number
7) Test it
8) If you would prefer, you can use this alternate code to force a redirect to the login page after 10 seconds (instead of immediately).
10) http://drupal.org/node/69007#comment-637218 (infinite loop error)
Another solution
I had a lot of problems with Google linking to old pages that I had done away with, the page not found errors were driving traffic away. The solution that worked for me is similar to the original solution but the php code is different. I don't even give the enduser an error message to begin with, I just redirect right off the bat. These are the steps that I took.
Replace yourURL with your homepage URL or the page you want redirected to. If you are using automatic aliasing make sure it is disabled.
This will redirect the error pages to the homepage. I choose to also redirect the access denied page because I figured the the "access denied" message might tempt some people to snoop or attempt to hack.
Hope this works
Your solution took me 30
Your solution took me 30 seconds, thank you.
Making it even more flexible
Hi Shevot,
Your solution worked like a charm. I am using the subdomain module on my drupal install, and wanted to redirect people back to the subdomain's homepage if they were trying to access a page not found. I modified one thing on your provided code, and now it's flexible enough to work with subdomains:
Hope this helps someone else out as well!
Awesomely easy
Super simple. Awesome!