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,



and it works now.

Leave a Reply