• Resolved wxwalsh

    (@wxwalsh)


    I have urls which contain the | character, such as B004R1R1SW|B003XQEVXU|B003XQEVXU

    Simple URL is stopping the processing immediately before the first | and sends nothing beyond that character.

    https://www.eliterate.org/go/a-tattoo-shop-mystery/

    Should redirect to

    https://www.amazon.com/s/ref=nb_sb_noss?url=search-alias%3Ddigital-text&field-keywords=B0028T82LA|B0030CVRHA|B004R1R1SW|B003XQEVXU&sort=popularity-rank&tag=cllink-20

    but instead if it is attempting to redirect to

    https://www.amazon.com/s/ref=nb_sb_noss?url=search-alias%3Ddigital-text&field-keywords=B0028T82LA

    https://www.ads-software.com/extend/plugins/simple-urls/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter wxwalsh

    (@wxwalsh)

    I found where the “_surl_redirect” data is set in the mysql db, and for now just edited the URLs to change | to the url encoded %7C manually. How can I edit plugin.php for simple URL to handle this itself?

    If anyone knows…

    edit/update:
    found line 128 of plugin.php where it says:
    update_post_meta($post->ID, $key, $value);

    I tried to use urlencode($value) but that encoded the entire string, including the :// in the front, and made it unusable.

    Any alternative suggestions anyone has would be helpful.

    Thread Starter wxwalsh

    (@wxwalsh)

    Probably not the best solution, but as an interim fix for this specific case, I added the following before line 128:

    $value = preg_replace('/\|/', '%7C', $value);

    I’m sure there is a better solution, but this will work for this specific case I have until a better fix is implemented.

    I couldn’t figure it out with my limited experience, but it seems the better logic might be to split incoming urls and run urlencode($querystring) on the query string portion, and eliminate whatever the cause of the problem is.

    Or, since the URL was being saved properly in the mysql table, perhaps the better solution might be in the count_and_redirect function to fix whatever is causing it to see | as not being a part of the outputted url?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Problem with URLs containing special character’ is closed to new replies.