You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If grav is installed as a subfolder /grav/ in web root mysite.com, an .htaccess in mysite.com can point to the grav installation. But for web admins on shared hosting without access to vhost config, it appears to be impossible to prevent browsers from visiting mysite.com/grav/ or mysite.com/grav/foo.
Assume that the install is within mysite.com/grav/, and add the following to the web root's .htaccess
Entering mysite.com/notgrav/foo, mysite.com/notgrav/, or mysite.com/notgrav results in the expected change, where /notgrav is removed from the address bar url.
Using shared hosting without access to vhosts config means—I think—that the only way to handle this situation and exclude /grav/ paths from showing up in the address bar would be to edit the grav install's .htaccess. But this is a disadvantage, since grav updates will overwrite it. An advantage of having grav in a subdirectory is that all .htaccess can be done in the web root, so only /grav/user needs to be tended to.
I apologize in advance if I have missed some already-available solution. If not, I propose that a change be made to allow removing /grav from outward-facing mysite.com/grav/foo urls.
The text was updated successfully, but these errors were encountered:
Thanks. I don't want to waste your time, and I might be misunderstanding something—but isn't it something in grav that is preventing .htaccess from rewriting paths with /grav/ (since it can rewrite any other path)?
Grav does control any path beneath the site.. i.e. /grav/some/folder and this is going to try to find a page that routes to that, if it doesn't find anything you are going to get a Grav issues 404. You can't remove the /grav part without the help of the webserver by setting up a vhost or similar as you mention.
You can however use the custom_base_url option in system.yaml to configure a different URL for the base of Grav. Perhaps this is what you are looking for?
Ok, thanks for getting back to me. I had assumed it would be possible without a 404, since my previous Wordpress would remove any external-facing /wordpress/ from the browser url. I'll check with my hosting provider or move to vps if I decide it's a big enough deal for me. Setting custom_base_url: "mysite.com" doesn't change the behavior. Thanks again. It's a minor issue, really.
If grav is installed as a subfolder
/grav/
in web root mysite.com, an.htaccess
inmysite.com
can point to the grav installation. But for web admins on shared hosting without access to vhost config, it appears to be impossible to prevent browsers from visitingmysite.com/grav/
ormysite.com/grav/foo
.Assume that the install is within
mysite.com/grav/
, and add the following to the web root's.htaccess
Entering
mysite.com/grav/foo
,mysite.com/grav/
, ormysite.com/grav
results in no change in the url displayed in the browser's address bar.But with
Entering
mysite.com/notgrav/foo
,mysite.com/notgrav/
, ormysite.com/notgrav
results in the expected change, where/notgrav
is removed from the address bar url.Using shared hosting without access to vhosts config means—I think—that the only way to handle this situation and exclude
/grav/
paths from showing up in the address bar would be to edit the grav install's.htaccess
. But this is a disadvantage, since grav updates will overwrite it. An advantage of having grav in a subdirectory is that all.htaccess
can be done in the web root, so only/grav/user
needs to be tended to.I apologize in advance if I have missed some already-available solution. If not, I propose that a change be made to allow removing
/grav
from outward-facingmysite.com/grav/foo
urls.The text was updated successfully, but these errors were encountered: