Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Support

Need help moving / setup grav on subdirectory but root URL

Started by Marco 1 year ago · 4 replies · 121 views
1 year ago

Hi, I hope this message finds you well 🎋🌻🎉
I'm trying to move a Grav install from a domain to another domain.

I was able to see all works just moving the folder in the new domain but what I want do this time is hide the subdirectory from the URL.

My new domain is www.newdomain.ext
Grav in reachable at www.newdomain.ext/grav/it where it is the language and is something added automatically when I load www.newdomain.ext/grav

Now I want that the home page showed at grav subfolder URL is showed when load the main url so from www.newdomain.ext/grav to www.newdomain.ext

I tried to follow the guide https://learn.getgrav.org/17/advanced/change-site-url but for me never works.

I tried to place in the root .htaccess the rule

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

But I get browser redirection loop error.

I tried to set the custom_base_url in system.yaml as custom_base_url: 'https://newdomain.ext' but still doesn't work.

I get redirect browser error.
Any help?

1 year ago

Why not just move your whole Grav installation from /grav to root?

1 year ago

Because in the root I have other files and things that should be not mixed.
Can the issue caused because to the grav folder is added automatically also the language?

www.domain.ext/grav redirect to www.domain.ext/grav/it
Seems not.

Maybe the issue is related I use the Plesk Panel?

The issue happen only while trying to setup an existent grav instance
If I setup a new grav no issues but I need just move my existent grab so what can be the cause of the infinite loop redirection?

Seems is not a server issue but a Grav issue.

last edited 02/06/25 by Marco
1 year ago

Why don't you use subdomains that point to a subdirectory within your site root?

For example, subdomain1.domain.com would be in the /subdomains/subdomain1 folder (with full Grav installation inside)

1 year ago

Because I need use grav for a specific domain.
Grav is a CMS that give content so my need is just to show that content on that domain.
In any case I created an install from zero and recreated pages one by one.

I was able to replicate often the issue of the loop redirection, even in a new install.
I also discovered that install a SEO extension made grav crash. Now I'm no more using a SEO extension.

It's not clear to me what can be done to resume back grav when an extension broke it. I tried to set disabled in the extension configuration file but grav was always still broken.

In any case now all is fine I setup grav on new domain but with an install from zero.

I was unable to move my existing grav from domain.ext/grav to domain.ext

Suggested topics

Topic Participants Replies Views Activity
Support · by Thomas, 1 week ago
2 50 6 hours ago
Support · by Anna, 2 days ago
2 58 9 hours ago
Support · by Justin Young, 10 hours ago
1 28 10 hours ago
Support · by Duc , 1 week ago
2 63 5 days ago
Support · by Colin Hume, 1 week ago
2 53 5 days ago