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:
Referred by:
User Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv: Gecko/20071127 Firefox/

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.