WordPress.org

Ready to get started?Download WordPress

Forums

Redirection
How to deal with apostrophes in source URL? (7 posts)

  1. Seamoose37
    Member
    Posted 1 year ago #

    Hi - I am experiencing trouble getting redirects to work from my client's old Business Catalyst website to the new wordpress site for source URLs that have an apostrophe in them. I have tried replacing the instance of the apostrophe in the source URL field to %27 and variations of this but to no avail. Anybody know how this is dealt with via the redirection plug in?

    Example:

    Source URL: http://www.tesselaars.com/_blog/Inside_Flowers/post/Online_Marketing_for_Florists_Part_1_–_A_Website_You_Won't_Regret/

    Target URL: http://www.tesselaars.com/online-marketing-for-florists/

    http://wordpress.org/extend/plugins/redirection/

  2. n8kowald
    Member
    Posted 1 year ago #

    I ran into this problem today and saw the following in the documentation:
    /tags/(.*?)-(.*?) => /tags/$1%20$2 <-- replaces hyphens with spaces.

    A fix is to use a dot-star grouping, followed by the character you want to exclude, followed by another dot-star grouping.

    This should work for you:
    Source URL: /_blog/Inside_Flowers/post/(.*)(\%E2\%80\%99|')(.*)
    Target URL: http://www.tesselaars.com/online-marketing-for-florists/

    The second group (\%E2\%80\%99|') handles apostrophes encoded like %E2%80%99 and '.

  3. Seamoose37
    Member
    Posted 1 year ago #

    Thank you for the help. Turns out I have a few examples that won't redirect as is, even after my attempt to implement above advice.

    The original example above actually looks like this:

    http://www.tesselaars.com/_blog/Inside_Flowers/post/Online_Marketing_for_Florists_Part_1_%E2%80%93_A_Website_You_Won%27t_Regret/

    So after your (kind) tip failed I tried:

    /_blog/Inside_Flowers/post/(.*)(\%E2\%80\%93)(.*)(\%27)(.*)

    but to no avail.

    Another example:
    http://www.tesselaars.com/_blog/Inside_Flowers/post/Valentine%E2%80%99s_Day_Statistics_2013/

    I currently have it set up as
    /_blog/Inside_Flowers/post/(.*)(\%E2\%80\%99|')(.*)

    But still the 404.
    Am I missing something?

  4. n8kowald
    Member
    Posted 1 year ago #

    I tested your redirects in my website and both work for me.
    Have you checked the 'Regular expression' checkbox?
    This is required otherwise the 'Source URL' is taken literally.
    Sorry, I forgot to say this in my original answer.

    Here's a screenshot of my working redirect: http://i.imgur.com/YeDt6OY.png

  5. Seamoose37
    Member
    Posted 1 year ago #

    Hey @n8kowald thanks again. Yes I have the same setting I am sure but it doesn't help. See screenshot:

    http://tesselaars.com/redirect.jpg

    maybe you or someone can see what I can't. This site by the way is windows hosted, any idea if this could be the reason? I have no idea.

    Thanks for your help it is much appreciated.

  6. n8kowald
    Member
    Posted 1 year ago #

    Your redirect is correct. Must be something else.

    1. Do any of your redirects with this plugin work? Your non-regular expression ones?
    2. Do you have access to your PHP error log? The problem might be reported in there.
      http://stackoverflow.com/a/4764452
    3. In 'Tools > Redirection > Modules', if you're using .htaccess Apache redirects, try temporarily disabling them and using the WordPress module instead

    Looks like you've tried this already but if not, try a non-regular expression redirect on:
    /_blog/Inside_Flowers/post/Online_Marketing_for_Florists_Part_1_%E2%80%93_A_Website_You_Won%27t_Regret/

    If this works and you need to find URLs for the other 404 pages you can use Chrome's Dev Tools: (F12) > Network > (reload page).
    Click the first item in the list and in the right hand side you can copy the 'Request URL': http://i.imgur.com/zoMJn73.png

  7. Seamoose37
    Member
    Posted 1 year ago #

    Hey mate,

    1. Yes there are hundreds working fine of both types
    2. Hmm that looks like a bit of a brain melter ... I have a friend who I am hoping will look at this for me ( ... right Rob? ;-P )
    3. Is already disabled and we are using WordPress apparently

    Tried your non-regex suggestion but no dice unfortunately

    Thanks for your help. Good karma is yours!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic