Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Installation & Hosting

Admin with apache reroute

admin

Started by Richard Hainsworth 9 years ago · 3 replies · 645 views
9 years ago

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.

9 years ago

But if I also want to have a /devel/ site using Grav?
The php solution - I think - will send everything to /2017/
Am I wrong?

9 years ago

Further on this.
I have converted the whole site to https.
Very poor variation as I self-signed the certificate, which will cause problems for Chrome users et al.

How can I get the Grav admin plugin to work with a redirect?

Suggested topics

Topic Participants Replies Views Activity
Installation & Hosting · by antoinep, 18 hours ago
6 63 3 minutes ago
Installation & Hosting · by Jürgen Dietrich, 7 months ago
0 65 7 months ago
Installation & Hosting · by rappluk, 8 months ago
0 64 8 months ago
Installation & Hosting · by N, 12 months ago
3 76 12 months ago
Installation & Hosting · by Youle, 1 year ago
1 63 1 year ago