Using Permanent Redirect with HTTP 301 to correct my nonexistent links

Because of some reasons, I have deleted some sub folders of my website, then I always get the “404 Report”, for example,

404 Report – a file not found error was registered on your site.
404 URL: http://blog.rubypdf.com/downloads/
Referred by: http://forum.telecharger.01net.com/microhebdo/logiciels/bureautique/convertisseur_pdf_en_ppt-334264/messages-1.html
User Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11

so I tried to set Permanent Redirect with HTTP 301 in .htaccess in this way

# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

Redirect 301 /download/index.php /download/
Redirect 301 /download/dl.php(.*) /downloads/dl.php$1
Redirect 301 /phpcounter/(.*) /
Redirect 301 /sitemap/(.*) /
# END WordPress

but it does not work now, and I had no idea why(I tried the same method in other folder, works), now I had to solve it in another way “HTTP 301 Redirect in PHP”, for example,

// Permanent redirection
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://blog.rubypdf.com/");
exit();
?>

and it works now.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Netvouz
  • DZone
  • ThisNext
  • MisterWong
  • Wists
  • BlinkList
  • blogmarks
  • blogtercimlap
  • connotea
  • DotNetKicks
  • Fark
  • Fleck
  • Gwar
  • Haohao
  • IndianPad
  • Internetmedia
  • LinkaGoGo
  • MyShare
  • Netscape
  • NewsVine
  • Rec6
  • Reddit
  • Scoopeo
  • Slashdot
  • StumbleUpon
  • Technorati
  • Webride

Leave a Reply

You must be logged in to post a comment.