Can I use .htaccess to redirect based on file type?
Posted on 2011-09-05
I have recently redeveloped a website that was originally done as an html-based side, but is now WordPress-powered (so, all php pages).
The old site was about 63 pages, and although I've put a redirect into each page via it's Dreamweaver template as a meta tag, I'm not happy with the fact that someone would actually have to load the old page to be redirected to the new one.
As such, I'm thinking if I could perform the redirect via the .htaccess file, that would be ideal.
Is it possible to use the .htaccess to redirect based on page type? For instance, can I tell it to redirect any page requests for .html files to the root web address?
Code examples would be appreciated.