Title: Issue Creating Headers
Last modified: December 19, 2022

---

# Issue Creating Headers

 *  Resolved [zacfor](https://wordpress.org/support/users/zacfor/)
 * (@zacfor)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/issue-creating-headers/)
 * I’m trying to add some headers via the Site>HTTP Headers area and keep running
   into this 500 error:
 *     ```wp-block-code
       Plugin: 5.3.6 4.2
       WordPress: 6.1.1 (single)
       PHP: 8.0.25
       Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36
       JavaScript: https://XXXX.wpengine.com/wp-content/plugins/redirection/redirection.js?ver=5.3.6-16d9cc72e7ac56bb977b78fce03e6ba0
       REST API: https://XXXX.wpengine.com/wp-json/
       Query: ?page=redirection.php&sub=site
       ```
   
 * I turned on debug logging and found this:
 *     ```wp-block-code
       [19-Dec-2022 18:07:20 UTC] PHP Warning:  Array to string conversion in /nas/content/live/XXXX/wp-content/plugins/redirection/models/header.php on line 108
       [19-Dec-2022 18:07:20 UTC] PHP Fatal error:  Uncaught TypeError: iconv(): Argument #3 ($string) must be of type string, array given in /nas/content/live/XXXX/wp-content/plugins/redirection/models/header.php:115
       Stack trace:
       #0 /nas/content/live/XXXX/wp-content/plugins/redirection/models/header.php(115): iconv('UTF-8', 'UTF-8//IGNORE', Array)
       #1 /nas/content/live/XXXX/wp-content/plugins/redirection/models/header.php(25): Red_Http_Headers->sanitize(Array)
       #2 [internal function]: Red_Http_Headers->normalize(Array)
       #3 /nas/content/live/XXXX/wp-content/plugins/redirection/models/header.php(8): array_map(Array, Array)
       #4 /nas/content/live/XXXX/wp-content/plugins/redirection/redirection-settings.php(223): Red_Http_Headers->__construct(Array)
       #5 /nas/content/live/XXXX/wp-content/plugins/redirection/api/api-settings.php(117): red_set_options(Array)
       #6 /nas/content/live/XXXX/wp-includes/rest-api/class-wp-rest-server.php(1171): Redirection_Api_Settings->route_save_settings(Object(WP_REST_Request))
       #7 /nas/content/live/XXXX/wp-includes/rest-api/class-wp-rest-server.php(1018): WP_REST_Server->respond_to_request(Object(WP_REST_Request), '/redirection/v1...', Array, NULL)
       #8 /nas/content/live/XXXX/wp-includes/rest-api/class-wp-rest-server.php(442): WP_REST_Server->dispatch(Object(WP_REST_Request))
       #9 /nas/content/live/XXXX/wp-includes/rest-api.php(410): WP_REST_Server->serve_request('/redirection/v1...')
       #10 /nas/content/live/XXXX/wp-includes/class-wp-hook.php(308): rest_api_loaded(Object(WP))
       #11 /nas/content/live/XXXX/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters('', Array)
       #12 /nas/content/live/XXXX/wp-includes/plugin.php(565): WP_Hook->do_action(Array)
       #13 /nas/content/live/XXXX/wp-includes/class-wp.php(399): do_action_ref_array('parse_request', Array)
       #14 /nas/content/live/XXXX/wp-includes/class-wp.php(780): WP->parse_request('')
       #15 /nas/content/live/XXXX/wp-includes/functions.php(1332): WP->main('')
       #16 /nas/content/live/XXXX/wp-blog-header.php(16): wp()
       #17 /nas/content/live/XXXX/index.php(17): require('/nas/content/li...')
       #18 {main}
         thrown in /nas/content/live/XXXX/wp-content/plugins/redirection/models/header.php on line 115
       ```
   
 * Not sure where to go from here.

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [John Godley](https://wordpress.org/support/users/johnny5/)
 * (@johnny5)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/issue-creating-headers/#post-16304182)
 * What header are you trying to create?
 *  Thread Starter [zacfor](https://wordpress.org/support/users/zacfor/)
 * (@zacfor)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/issue-creating-headers/#post-16306693)
 * Any, really. X-Frame-Options, Referrer-Policy, Strict-Transport-Security, X-XSS-
   Protection, and X-Content-Type-Options. They all exist on production right now,
   and I’m trying to recreate them on staging and add two more. They’re both WP 
   Engine environments, which as far as I can tell are the same. Very strange.
    -  This reply was modified 3 years, 4 months ago by [zacfor](https://wordpress.org/support/users/zacfor/).
 *  Thread Starter [zacfor](https://wordpress.org/support/users/zacfor/)
 * (@zacfor)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/issue-creating-headers/#post-16307877)
 * Just realized WP Engine has their own tool for implementing HTTP Headers, so 
   I’ll just use that. Thanks anyway!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Issue Creating Headers’ is closed to new replies.

 * ![](https://ps.w.org/redirection/assets/icon-256x256.jpg?rev=983639)
 * [Redirection](https://wordpress.org/plugins/redirection/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/redirection/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/redirection/)
 * [Active Topics](https://wordpress.org/support/plugin/redirection/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/redirection/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/redirection/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [zacfor](https://wordpress.org/support/users/zacfor/)
 * Last activity: [3 years, 4 months ago](https://wordpress.org/support/topic/issue-creating-headers/#post-16307877)
 * Status: resolved