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 →

I would like to run grav in a subdirectory of public_html on siteground

Started by Norma White 9 years ago · 1 replies · 913 views
9 years ago

I have tried to write .htaccess to access it.
So www.nhbpeterborough.com/carrytwo works perfectly.
But .htaccess writtten as documented at siteground failed to find the application for nhbpeterborough.com.
Support at siteground made several attempts to do the redirection and failed.

Finally, in response to my ticket they say
"It seems that your application rewrites the urls to the sub-folder and causing a redirect loop when trying to mask the carrytwo in the URL bar."

I see that GRAV has a complex .htaccess in its own root.
Siteground recommends creating .htaccess in public_html containing the following
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?nhbpeterborough.com$
RewriteCond %{REQUEST_URI} !^/nhbpeterborough.com/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /carrytwo/$1

RewriteCond %{HTTP_HOST} ^(www.)?nhbpeterborough.com$
RewriteRule ^(/)?$ carrytwo/index.php [L]

This is what creates the loop referred to above.

Might it be possible to have a .htaccess in public_html that combined GRAVs requests with this? Or any suggested solution?

Thanks
Norma

Thanks
Norma

9 years ago

I fixed this myself by making the subdirectory a subdomain and redirecting to it.
Norma

Suggested topics

Topic Participants Replies Views Activity
General · by themetman, 23 hours ago
2 40 16 hours ago
General · by Hanns Mattes, 1 week ago
0 121 1 week ago
General · by Karmalakas, 1 week ago
2 185 1 week ago
General · by Hanns Mattes, 3 weeks ago
0 235 3 weeks ago
General · by Dima, 4 weeks ago
1 211 4 weeks ago