4

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 +?

  • 3
    If you found a solution yourself, pleace write it as an answer and accept it, so it may help others to see that this question was solved, thanks. – birgire Jul 27 '16 at 14:11
3

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', '/',
urlencode(ltrim(stripcslashes($_REQUEST['custom_permalink']),"/"))) );

to

add_post_meta( $id, 'custom_permalink', str_replace(array('%2F','%2B'),
array('/','+'),
urlencode(ltrim(stripcslashes($_REQUEST['custom_permalink']),"/"))) );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.