I am deploying a PHP web application into a linux server for my client.
Their linux webserver allows wildcard subdomain, the server have SSL on. I have set up the virtualhost for the wildcard subdomain and no problem occurs, the problem is when i tried to use http:// instead of https:// on a wildcard subdomain, it links to other URL, it links to the clients own application. I tried asking them about their server setting that redirects the non-https and they said they have no idea. I tried modifying the .htaccess to redirect any http request to https but it does not work too, I suspected that there must be a missing server setting that caused this.
I have little knowledge on linux web server, and am really confused where should I even begin to search for this kind of problem, I've tried google for days and have not been able to find any solution.
here is my .htaccess setting, i put it on the root application.
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [QSA]
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301]
the first rule is to delete index.php from the link, it works perfectly fine. the second one is to redirect from http to https.
Any kind of answer or insight are very appreciated