everyone.
My problem is simple, but I cannot manage to find a solution.
All I need to do is use RewriteRule on Apache to redirect all request from a hostname to its FQDN.
For example, if the request is https://hostname/test.html, I want Apache to redirect the request to https://hostname.test.com/test.html. This has to be rewritten to any request to that hostname.
How can I do this?
Edit 1:
I've noticed that the following RewriteRule works for HTTP, but not for HTTPS:
RewriteCond %{HTTP_HOST} ^hostname$
RewriteRule ^(.*)$ https://hostname.test.com%{REQUEST_URI} [R,L]
What am I missing?
BR