Really impressed with Grav so far, though a couple of issues when I pushed the site to a host running Apache.
Moved setup to: /public_html/[site], and want now to remove the [site] from the URL and map it to the root. I’ve followed the docs (https://learn.getgrav.org/advanced/change-site-url), and tinkered with .htaccess but with no luck; always ends with a 403 when visiting the route, so I’ve just set up a redirect on cpanel for now as a rough fix.
Has anyone done exactly this and can provide a howto?
For the sake of organisation, having folders under public_html is useful: I have a few subdomains and another add-on. I’ve put the site in a folder there too, surely that should be fine?
I’m not able to change the root of the main domain to the subfolder for some reason, but it should be possible from cPanel as procrates mentioned.
Ultimately, annoyingly, the grav url includes the subfolder name, and I’d like to remove that:
And yes it should work to edit the .htaccess to use a sub-folder.
## Begin RewriteBase
# If you are getting 500 or 404 errors on subpages, you may have to uncomment the RewriteBase entry
# You should change the '/' to your appropriate subfolder. For example if you have
# your Grav install at the root of your site '/' should work, else it might be something
# along the lines of: RewriteBase /<your_sub_folder>
##
# RewriteBase /
Did you uncomment # RewriteBase / and add your sub-folder?
If there is one tip I should give you it should be: Start over (backup your user folder, make your domain folder root to Grav even if you have to change the server block, install Grav again and replace user folder with your folder.)
The bigger your site become the harder it is to change it if you do some hacky solution now. Trust me… Done that.