I have inherited a web app. It's running fine. But it's using HTTP, not HTTPS. This is the .HTACCESS
file:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L] </IfModule>
HTACCESS files are not my area of expertise. What I think this is doing is, "if there is NO specific file name, redirect to INDEX.PHP including any query string, then stop processing rewrite rules.
We need the page to default to index.php
as it does, but if other links are specified, do not redirect to index.php
.
What I need to do is this:
If no page is specified, default to
HTTPS://example.com/index.php
(with query string if any)If a page IS specified, redirect it to HTTPS if it is NOT already on HTTPS.
In other words, the entry point should redirect to index.php
over HTTPS, and every specified page should redirect over HTTPS (including query strings).
Something so simple, but I can't figure this out.
</IfModule>
- can you clarify whether you have anything else in the file, eg. a corresponding opening<IfModule>
tag perhaps? Can you clarify what you mean by "page"? Is this any URL-path? Or a URL that maps to an actual file?