# Problem with change header location

**URL:** https://discourse.roots.io/t/problem-with-change-header-location/20830
**Category:** sage
**Created:** 2021-05-24T13:17:20Z
**Posts:** 5
**Showing post:** 5 of 5

## Post 5 by @alwaysblank — 2021-05-24T17:28:05Z

> [@grzesiek1owline](#):
>
> `header('Location: ' . $provider->makeAuthUrl());`

You’re attempting to modify headers inside of a Composer, which you can’t do. By the time a Composer is being executed, the headers for whatever page you’re on have already been sent (in this case by wp-scripts, apparently). If you need to conditionally modify headers, you’ll need to hook into a action like [`wp_headers`](https://developer.wordpress.org/reference/hooks/wp_headers/) or [`send_headers`](https://developer.wordpress.org/reference/hooks/send_headers/), and do it outside of a Composer. Composers are meant for _modifying data and passing it to views_, not for containing redirect functionality, which appears to be what you’re trying to do here.

---

_[View the full topic](https://discourse.roots.io/t/problem-with-change-header-location/20830)._
