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.

General

Routing/Redirecting Fails?

Started by Greg Curtis 7 years ago · 0 replies · 372 views
7 years ago

Hi,

Site is available at https://site.co, which is fine, but all URL's are also available at https://site.co/site, which I want to prevent.

Tried editing site.yaml as per the docs ...

TXT
redirects:
#  '/redirect-test': '/'     # This works
#  '/site/(.*)': '/$1'          # Fails?

Tried a few other things, including redirecting in each page, but no luck; I think due to there being a resource at the URL, preventing the redirect.

Should I be redirecting, or is there a better way; preferably that can be applied globally?

Cheers.

Suggested topics

Topic Participants Replies Views Activity
General · by Jerry Hunt, 4 days ago
2 76 7 hours ago
General · by pamtbaau, 13 hours ago
1 47 12 hours ago
General · by Andy Miller, 1 day ago
0 44 1 day ago
General · by Marcel, 12 months ago
6 346 5 days ago
General · by Duc , 5 days ago
3 40 5 days ago