I have some old .swf
files/links for a website and they currently lead to a 404 Not Found
page.
I was wondering if there was a simple way, using .htaccess
(or any other method you may recommend) to redirect these files/links to my websites homepage http:www.mysite.com/home
.
Example links:
http://www.mysite.com/folder/file.swf
http://www.mysite.com/file.swf
What Is a 301 Redirect? A 301 redirect is a permanent redirect. When a user tries to access an old URL, the server sends their browser the 301-Permanently Moved status code and sends them to another page. This is useful for site owners and users because it means they are directed to the next most relevant page.
htaccess rewrite rules can be used to direct requests for one subdirectory to a different location, such as an alternative subdirectory or even the domain root. In this example, requests to http://mydomain.com/folder1/ will be automatically redirected to http://mydomain.com/folder2/.
This should work:
RewriteEngine On
RewriteRule ^.*\.swf$ /home [R=301,L]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With