I’m using PHP with the Symfony framework for my web projects. The framework allows you to switch between development and production environments.
A common problem with redirects is that you won’t see PHP errors / warnings when redirecting. My idea was to disable auto-redirection at all in the development environment and to provide a link for the target location (with href as defined in the “Location”-header) instead.
A simple solution is setting the status-code to 20X instead of 30X, i.e. not redirecting at all when running in development environment. But I don’t like that due to problems with testing, etc.
Do you know a better solution?
you should be able to catch php logs and use exception for any fatal errors.
You could disable the redirect page by page. or set up unit tests to check its all working the way you expect