How to resolve "bad encoding" redirection warning

For technical support and bug reports for all editions of CSS HTML Validator, including htmlval for Linux and Mac.
TomHTML
Rank III - Intermediate
Posts: 75
Joined: Sun Feb 04, 2018 10:19 am

How to resolve "bad encoding" redirection warning

Post by TomHTML »

One of my URLs/folders redirects to its parent directory. I send these headers:

Code: Select all

header("HTTP/1.1 301 Moved Permanently"); 
header("Location: ../");
The validator reports "200 (redirected)" but also states:
1 redirection to: "../" (301 - 'Moved Permanently' redirect). WARNING: Redirected to one or more locations with bad encoding (like an unencoded space character).
I'm not clear on how to encode the Location header to satisfy the Validator. What should be changed?
User avatar
Albert Wiersch
Site Admin
Posts: 3785
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX

Re: How to resolve "bad encoding" redirection warning

Post by Albert Wiersch »

Thank you for the report... I may not be able to look into this until next week though, due to the US Thanksgiving holiday.
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial
User avatar
Albert Wiersch
Site Admin
Posts: 3785
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX

Re: How to resolve "bad encoding" redirection warning

Post by Albert Wiersch »

UPDATE: Thank you for the report. This has been fixed for 2022/v22, expected to be released in January 2022.
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial