I am writing a .htaccess to be able to softly update my website, preventing new coming users to access it, and already connected users to be softly redirected, taking account that there are some image rollovers, css styles and async PHP and js calls in the process that can be called within a displayed page without needing to reload a new page from the web site.
Just redirecting anything to an update.php page would generate some unwanted effects on the pages that contains such things.
So I am fighting since days to find the correct set of rules to put in my .htaccess to achieve the following goal. Can you help me ?
If specialpage.php is called (even with parameters) redirect to specialpage_redirected.php
If specialpage2.php is called (even with parameters) redirect to specialpage2_redirected.php
if any other php file is called (even with parameters) redirect to redirected.php
If specialscript.js is called redirect to specialscript_redirected.js
If any other .js is called redirect to redirected.js
and let all other files be accessed (css, images, ...)
... or if you have a better solution to achieve this goal to put the site offline for a maintenance, taking the previous constraints (already connected users on dynamic pages) into account.