I’m currently working on a new website that I need to migrate from an old CMS to WordPress. The old system had some URL values with ID’s in it:
http://www.domain.ltd/page+1234.
When I place this url in WordPress, the URL gets a 301
redirect to the same URL with the value: %2B
. Can someone help me out to get rid of the redirect and just show the URL with the +
?
Per the OP, here is their answer which I separated from the question:
I have found a solution for it myself, I’ve used the Custom Permalinks plugin and edited how the special characters are saved in the database. For the people who want to use this, change:
add_post_meta( $id, 'custom_permalink', str_replace('%2F', "https://wordpress.stackexchange.com/",
urlencode(ltrim(stripcslashes($_REQUEST['custom_permalink']),"https://wordpress.stackexchange.com/"))) );
to
add_post_meta( $id, 'custom_permalink', str_replace(array('%2F','%2B'),
array("https://wordpress.stackexchange.com/",'+'),
urlencode(ltrim(stripcslashes($_REQUEST['custom_permalink']),"https://wordpress.stackexchange.com/"))) );