Subfolder "grav" in url


On my web hosting, I would like that the subfolder “grav” disappear from the URL.

I don’t have access to apache vhost config.

Is it possible with .htaccess in the www folder ? (I didn’t succed) or should I move everything to www without subfolder grav ?

Thank you


I’ve found the solution in the documentation Change the site URL. In “Scenario 1, run in the domain root folder

Grav is installed in http://my_site/grav/ I want it to respond on http://my_site

In grav/user/config/system.yaml, I set

custom_base_url: ‘http://my_site’

and set the session path to the (new ?) Grav site path,
path: /
(I don’t understand why the path is / and not /grav)

And in the domain root, set the redirect, e.g. with .htaccess:

RewriteEngine On
RewriteCond %{REQUEST_URI} !^/grav/
RewriteRule ^(.*)$ /grav/$1

It works and this is what I was looking for.
But it’s not so easy to understand, and http://my_site/grav/ continue to give the pages. So maybe I should find something to complete the configuration. Maybe with the htaccess file.