-1

I want to Redirect this 404 error URL to a Static URL. How this is possible. Please help..

URL http://www.takeshiyashima.com

/us/my-blog?catid=1&id=404:my-thought-of-the-day-problem-of-traditional-education  
/ja/resources?id=366:video-clip  
/ja/resources?id=364:mortgage-reset-second-big-wave 
/us/my-blog/65-investment?catid=230&id=230:wealth-cycle9 
/us/resources?catid=72&id=354:fractional-reserve-banking
/us/my-blog?catid=1&id=432:petrodollar-system-inevitable-economic-collapse-and-possibility-of-world-war-iii 
/tw/?catid=0&id=539 
/tw/?catid=0&id=519 
/ja/resources?catid=72&id=357:flaw-of-401k 
/us/my-blog/65-investment?catid=301&id=301:my-recent-real-estate-deal-and-why-i-am-investing-in-real-estate 
/tw/?catid=0&id=502
/ja/?catid=0&id=516 

I have 561 error in google webmaster. Please help me to redirect this type of URL.

2 Answers2

0

use .htaccess redirection

ErrorDocument 404 http://example.com/404/

RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_URI} ^/404/$
RewriteRule ^(.*)$ /pages/errors/404.php [L]

Blog: Redirect your 404 error to a Custom Page
Answer on Stack Overflow

Community
  • 1
  • 1
Mohammad Faisal
  • 5,783
  • 15
  • 70
  • 117
  • What to do ?? copy the code to my .htaccess as you given or i have to change something. Please give me a specific code which will sure work and Google bot can crawl the page. I have tired of trying a lot of code. I have already a 404 page but i want this URL to redirect in specific Static URL. – graphic designer May 14 '14 at 11:48
0

If you want to, say, redirect all requests for a non-existent page to http://example.com/404.php, just add the following line to your .htaccess file:

ErrorDocument 404 http://example.com/404.php

However, it's often better to serve 404.php page without visibly changing the URL. This is even easier:

ErrorDocument 404 /404.php

Note that, with the latter solution, those pages will still show up as 404 errors e.g. in Google's webmaster tools. However, that is actually a good thing, since it lets you tell missing pages apart from redirects. Users visiting those pages will still see your 404.php page, just served under the missing page's URL, and with a 404 status code.

For more information, see Custom Error Responses in the Apache documentation.


Ps. Note that this will not work if your 404 errors are generated by some application framework or script (i.e. the script is successfully executed, but deliberately returns a 404 response, e.g. because it can't find the requested resource in the database). In that case, the solution will depend on the specific application or script.

Ilmari Karonen
  • 49,047
  • 9
  • 93
  • 153
  • Actually I want /us/my-blog?catid=1&id=404:my-thought-of-the-day-problem-of-traditional-education this URL to redirect in http://www.takeshiyashima.com/us/my-blog/1-my-thought/404-my-thought-of-the-day-problem-of-traditional-education this URL. And All the URL i want to redirect in their similar URLs. – graphic designer May 14 '14 at 12:12
  • @graphicdesigner: Do you have a list / database of which URL should redirect to which one? – Ilmari Karonen May 14 '14 at 12:33
  • I have the list of crawl error URL but I didn't make any list for redirection URL. here is the link of the url to redirect in their similar pages https://www.dropbox.com/s/anvg3atbdw9aqvy/www-takeshiyashima-com_20140514T075551Z_CrawlErrors.csv .. – graphic designer May 14 '14 at 12:44
  • You may understand some URL i just want to remove the parameter. I give you some example below. 1> ja/resources?id=366:video-clip TO http://www.takeshiyashima.com/ja/resources 2> a/resources?id=364:mortgage-reset-second-big-wave To http://www.takeshiyashima.com/ja/resources 3> /us/my-blog/65-investment?catid=230&id=230:wealth-cycle9 TO http://www.takeshiyashima.com/my-blog/65-investment/230-wealth-cycle – graphic designer May 14 '14 at 12:48