Wednesday 6 November 2013

RewriteRule; Moved Permanently

I was getting high numbers of 404 "file not found" on my server do to discontinued blog's I hosted long a go. To reduce those numbers I used .htaccess to redirect all requests to another page using the 301, "Moved Permanently" code.

Example:
RewriteRule ^blogfolder\/?(.*)$ "http\:\/\/newdomain\.com\/" [R=301,L]
Live example:
http://acme.to/blogfolder/foo.html