I am developing a Grav website on a remote provider, which runs under Ubuntu with Apache and php
Assume my domain name is mydomain.org
I have a Grav website installed in a directory /2017/
, that is relative to the web root.
So a normal url mydomain.org/2017
works fine. Got everything working, and mydomain.org/2017/admin
also works fine.
But I want the url mydomain.org
to reroute to mydomain.org/2017
First attempt was to add line RedirectMatch ^/$ /2017/
to .htaccess
in the web root directory.
This works correctly except that the opening page is shown in the browser’s location as mydomain.org/2017/...
But I do not want the ‘2017’ to appear.
I played around with .htaccess
with various solutions, but I could not get anything to work.
Next I followed the instructions from learn.getgrav.org/advanced/change-site-url
(substituting 2017 in place of ‘get-grav’) and I got the required result.
BUT now neither mydomain.org/admin
, nor mydomain.org/2017/admin
will work. The latter generates a 404 error, which is understandable since there is no directory /2017/2017
, but the first variant is tricky. I get the correct login page, and a valid user name is prompted as expected. However, the password is not accepted.
Since I use Firefox as my default browser, I have to over-ride a warning because /admin is on http, not https.
However, even with a warning over-ride, the password is not accepted.
I would prefer - of course - to have access to the site as http for normal users, but for /admin to be only available on https. This however, is a different topic. A link to an answer would be useful.