Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

.htaccess rewrite if address includes /grav/ subdirectory in path?

Started by paul 7 years ago · 3 replies · 1036 views
7 years ago

My grav install is in a subdirectory of my web root. The web root's .htaccess redirects mysite.com/foo traffic to mysite.com/grav/foo, while the address bar in the browser continues to just show mysite.com/foo. All good.

But I can still enter mysite.com/grav/foo in the address bar, and the 'foo' page loads, while the address bar continues to show /grav/ in its path. That's

Is there a way to change this without changing the default .htaccess in /grav/ ?

7 years ago

I would like to avoid altering the .htaccess of the grav installation itself to maintain the way grav allows us to only tend to the grav/user folder.

And as a user of shared hosting, I don't have access to apache vhost config.

So without finding a solution to my issue, I've added an issue on github.

7 years ago

I'm a little confused with what your saying/asking.

Do you only want visitors to be able to see mysite.com/foo even if the go directly to mysite.com/grav/foo

👍 1
7 years ago

Hi, thanks for replying. Yes, that's exactly right.

Suggested topics

Topic Participants Replies Views Activity
Installation & Hosting · by DrPen, 6 days ago
4 117 4 days ago
Installation & Hosting · by vollstock, 3 weeks ago
3 221 3 weeks ago
Installation & Hosting · by David, 7 years ago
3 3508 1 month ago
Installation & Hosting · by David Meissner, 1 month ago
3 345 1 month ago
Installation & Hosting · by David Meissner, 1 month ago
0 269 1 month ago