Use case is a Wordpress installation, with another in subdirectory setup through cPanel.
Code was generated for standard redirection of subfolder to index.html in subfolder subDir:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^subDir$ "https\:\/\/mySite\.com\/subDir\/index\.html" [R=301,L]
RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^subDir\/$ "https\:\/\/mySite\.com\/subDir\/index\.html" [R=301,L]
[R=301,L]
...
The redirect always works when clicking the jumplink in home page, mySite.com/subDir.
The issue is when the browser cache is completely cleared for the time interval the redirect was issued, the redirect won't work. For example, issue the redirect, and immediately proceed to clear the entire browser cache and history (for the last hour is recommended.) In testing with MS Edge, disabled LiteSpeed, chose all options in the dialog shown barring Passwords, Autofill and Media Foundation Data:
Once that is performed, reload the base homepage to find the jumplink now redirecting to the WP home page, subDir/index.php, instead of subDir/index.html.
As the WP setup/theme is close to default, by that there is no Cache-control code used anywhere in WP, the above behaviour is by design and the redirect can be easily recreated by editing the .htaccess file. For positive effect, the type of .htaccess edit may vary depending on browser, for a WP site showing in Chrome it usually amounts to the inclusion or exclusion of something fairly benign like:
RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^subDir\/index\.php$ "https\:\/\/mySite\.com\/subDir\/index\.html" [R=301,L]
Once this edit is made, the jumplink will not redirect to subDir/index.html unless (my bold) the browser cache is purged again.
Without going down the rabbit hole of grepping 301 response headers in user caches, it would seem apt, if not somewhat inelegant, by regularly (bi-monthly / yearly etc.) editing the server .htaccess to address the rare occurrence of redirection issues post cleared cache by user.
Is this reasonable, or does a better method (other than a hard mySite.com/subDir/index.html jumplink on the home page) exist?
