Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

500 Error when trying to open non renamed page #1446

Closed
CoDanny opened this issue Apr 23, 2017 · 2 comments
Closed

500 Error when trying to open non renamed page #1446

CoDanny opened this issue Apr 23, 2017 · 2 comments

Comments

@CoDanny
Copy link

CoDanny commented Apr 23, 2017

In our Grav installation (available upon request), we had a page /products/p/astrobox which was moved to /products/p/astrobox-gateway.

Google Webmaster tools detected an error 500 when trying to access the old route, instead of the expected 404. Looking in the logs in our dev environment the error is:

PHP message: PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 67905 bytes) in /Users/arroyo/3dagogo-repos/astroprint/CMS/www/system/src/Grav/Common/Page/Pages.php on line 410" while reading response header from upstream, client: 127.0.0.1, server: ~www.astroprint.(dev|net|intranet)$, request: "GET /products/p/astrobox HTTP/1.1"

Using Grav 1.2.3

@rhukster
Copy link
Member

I'm not able to replicate a simple moved page causing a 500 error. The only think i can think of off hand is some redirect or rewrite rule (either in Grav or webserver) that is getting in the way.

is it possible to get a zipped copy of this site to see if I can replicate the issue?

@rhukster
Copy link
Member

rhukster commented Apr 24, 2017

It's this route in your site.yaml your redirect is the problem. It's matching :

routes:
 /p/astrobox: /products/p/astrobox-gateway

Commenting it fixes the problem and you get a 404. I'm going to put a 'fix' in for Grav core that forces appending a ^ to the start of the regex which will cause it to match from the start of the route only.

Pages.php - line 424:

$pattern = '#^' . $pattern . '#';

or you can just prefix your route setup with a ^:

routes:
 '^/p/astrobox': /products/p/astrobox-gateway

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants