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

Direct links lead to /home on first load

Solved by Vincent View solution

Started by Vincent 6 years ago · 7 replies · 528 views
6 years ago

Hey guys,

On my page I have a subpage somepage.com/press, now when I send someone that direct link to somepage..com/press, it will always load somepage..com at first, then the second time when somepage..com/press is entered, it actually loads that subpage...

I tried playing around with routes and redirects of site.yaml and htcaccess, but without success.

Can you give me a hint on why this behaviour happens? Because I have no clue at the moment...

Thanks, Vincent

(the double dots in the links are due to "new users can only post two links in a post")

I'm running on
Grav v1.6.28
Nginx 1.10.3
PHP 7.1.33
Ubuntu 16.0.4

6 years ago

Hi @vince --

Can you share the actual link so we can get a better read on the problem?

-- phi

6 years ago

yes, sure.

So the direct link I want to send to people is https://12-s.de/presse
On first visit that link it will redirect to 12-s.de, when you then type in the /presse it will lead you to the actual subpage

Edit: That actually happens with all subpages, maybe it's just a simple caching problem...?

last edited 11/04/20 by Vincent
6 years ago

On my first visit to https://12-s.de/presse after clicking your link, I believe I received the correct page:

image|690x319

Same for both firefox and chrome.

Did you try clearing your browser cache?

6 years ago

Hmm you're right, it leads to the correct page.
However, when I type in the url (including subpage and after clearing browser cache) by hand it redirects to the mainpage...
That's really weird, but I guess I can live with that as long as clicking the links works.

Thank you very much

6 years ago

Just had a hunch -

If I type in http://12-s.de/presse or 12-s.de/presse without https, it redirects to your homepage with https.

Check your force_ssl setting in your system.yaml and your .htaccess?

👍 1
6 years ago Solution

Damnit, now I feel stupid... 😅

It wasn't in the grav configuration, but in the nginx server block.
I simply forgot to put "$request_uri" after "return 301 https://$host" when redirecting from http to https, so of course it would just redirect to the mainpage.

You brought me on the right track here, awesome! Thanks again!

6 years ago

@vince - Glad it worked!

There are so many knobs and switches on these contraptions. Hard to get to a handle on all of it.

Suggested topics

Topic Participants Replies Views Activity
Support · by Thomas, 1 week ago
2 53 10 hours ago
Support · by Anna, 3 days ago
2 60 13 hours ago
Support · by Justin Young, 14 hours ago
1 30 14 hours ago
Support · by Duc , 1 week ago
2 65 5 days ago
Support · by Colin Hume, 1 week ago
2 56 5 days ago