Say I have a web folder with:
/index.html
/assets/css/styles.css
/assets/images/logo.png
/something.html
/holdingpage.html
/finale.html
/folder/somefile.html
/else.html
/PDFs/something.pdf
I want to put in place an htaccess RedirectMatch for this to "catch" all the files that are html files except the finale.html and redirect to there.
What I have so far is:
RedirectMatch 302 ".*/$" "/finale.html"
Which correctly catches all folder without filenames (indexes). What I need is to catch all the html but not that destination one.
RedirectMatch 302 ".*(\.html)$" "/finale.html" # This loops obviously.
So I tried to be more specific;
RedirectMatch 302 ".*!(finale.html)$" "/finale.html"
RedirectMatch 302 ".*!(finale\.html)$" "/finale.html"
But this doesn't catch other files. Also by the looks of it I'd expect this to also catch assets and images.
I am trying to find a redirectMatch that finds every .html page that is NOT finale.html and redirect it to that page.
IT should be a redirectMatch and NOT a rewriteCond / rewriteRule. The user needs to see they're being redirected.
I imagine I want something like:
RedirectMatch 302 ".*((\.html) BUT NOT (finale.html))$" "/finale.html"
I have read the Apache Documentation but this doesn't really elaborate on this concept very much.