getgrav / grav

Modern, Crazy Fast, Ridiculously Easy and Amazingly Powerful Flat-File CMS powered by PHP, Markdown, Twig, and Symfony
https://getgrav.org
MIT License
14.48k stars 1.4k forks source link

Problem with in-page redirect #781

Closed sebastianha closed 8 years ago

sebastianha commented 8 years ago

Hi,

I have a problem with redirects configured directly in the page header. I use a fresh installed grav, version 1.0.10, I just added user pages like the following:

/home/default.md:


---
title: Home
visible: false
redirect: '/content-2'

---

and

/00000.2/default.md:


---
title: Test
routes:
  default: '/content-2'

---

When I access my main page ("/") or the page "/content-2" I get always redirected to "/content-2". This leads to "Too many redirects" as the site redirects to itself.

With Version 1.0.5 this worked, now it doesn't. Any Idea what I am doing wrong?

flaviocopes commented 8 years ago

Not able to reproduce, not sure if there's an external/unconsidered possible cause. Can you try replicating with a clean skeleton?

sebastianha commented 8 years ago

Mmmh, it was a clean install, just unzip and create the two user pages. I also tried just to create a second user page but I have the same problem: As soon as I add the redirect to the home page every site redirects to the targeted page. I am using NGINX and PHP 5.6.20. I will try it on another system.

flaviocopes commented 8 years ago

Do you mind sending me the user/ folder zipped via Gitter PM? Maybe I tested the wrong page.

Il giorno lun 11 apr 2016 alle ore 19:17 Sebastian Hammerl < notifications@github.com> ha scritto:

Mmmh, it was a clean install, just unzip and create the two user pages. I also tried just to create a second user page but I have the same problem: As soon as I add the redirect to the home page every site redirects to the targeted page. I am using NGINX and PHP 5.6.20. I will try it on another system.

— You are receiving this because you commented.

Reply to this email directly or view it on GitHub https://github.com/getgrav/grav/issues/781#issuecomment-208455904

rhukster commented 8 years ago

I have confirmed that a redirect on the home alias causes this problem. Redirects on other pages, including multiple redirects works fine. I'm not sure why you would want a redirect on the homepage, (just change the home: alias !) but I guess this is a bug :)

sebastianha commented 8 years ago

Thanks for confirming this!

I am generating the user pages from DB content (including the homepage) and I only want to touch the pages folder. That's why I am doing the redirect here and not in the configuration files.

rhukster commented 8 years ago

Ok sorted it out!