WordPress.org

Ready to get started?Download WordPress

Forums

Redirection
category links will not redirect (7 posts)

  1. sunriseweb
    Member
    Posted 2 years ago #

    I am trying to 301 redirect an old category permalink to the new one, but it does not work. The redirect does not happen.

    Source URL = /category​/village-voices​/
    Target URL = /category/ooka-voices/

    I set up another redirect that DOES work:

    Source URL = /online-adventure/advance-purchase/
    Target URL = http://lighthouse.ookaisland.com:8080/OokaSpringFramework/download/step1.htm

    Here is a link to a screenshot of the redirects I have set up.

    Any idea why the "category" redirect won't work. Ideally I will us Regex eventually like:

    Source URL = /category​/village-voices​/(.*)
    Target URL = /category/ooka-voices/

    since there are sub-categories as well.

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

  2. zzlong
    Member
    Posted 2 years ago #

    Your "category" redirection looks fine. Some random thought:

    1. Did you get the Source URL by copy-and-paste from the Redirection plugin 404 log? For unknown reason the text copied from this screen contains an invisible character before every "/". I figured it out after scratching my head for a whole day.

    2. You may clear the cache of your browser and try again. Firefox remembers the 1st version of the rule. It doesn't query the server with Source URL anymore and go ahead with the cached Target URL.

    By the way, I don't think you need to change the rule to Regex. This plugin matches the Source URL with the prefix of the URL that it received from the browser, and replace this part with the Target URL. The trailing part will be kept in the generated URL.

  3. sunriseweb
    Member
    Posted 2 years ago #

    Thanks for your help zzlong - unfortunately still have the problem.

    1. I tried removing and replacing the redirect using copy and paste from Notepad to ensure I didn't have special characters. (in fact at one point it does look like /category%E2%80%8B/village-voices%E2%80%8B/ was being used.

    2. I tried using different browsers - Safari, Chrome, Firefox - all with the same result - no redirect.

    The reason I want to use regex is that the sub-categories no longer exist either - so I want any references to the /category/village-voices/ category and any sub-categories, or posts within to go to /category/ooka-voices/ post listing. Regex (.*) needed right?

    Might dig into the code a bit and do some debugging.

  4. Boeffi
    Member
    Posted 2 years ago #

    First of all, congratulations for this plugin. I'm still experimenting and I'm very excited :-)

    Source URL = /category​/village-voices​/(.*)
    Target URL = /category/ooka-voices/

    Try:
    Target URL = /category/ooka-voices/$1

    cu
    @Boeffi - http://blog.boeffi.net

  5. zzlong
    Member
    Posted 2 years ago #

    Try:
    Target URL = /category/ooka-voices/$1

    I suggest:

    Source URL = /category/village-voices/(.*)
    Target URL = /category/ooka-voices/

  6. Boeffi
    Member
    Posted 2 years ago #

    Source URL = /category​/village-voices​/(.*)
    Target URL = /category/ooka-voices/$1

    ... without the regex-var $1 you'll usually lose the content of the (.*) part ...

    cu
    @Boeffi - http://blog.boeffi.net

  7. zzlong
    Member
    Posted 2 years ago #

    ... without the regex-var $1 you'll usually lose the content of the (.*) part ...

    You are absolutely right, and I think that is what sunriseweb expecting. He said:

    The reason I want to use regex is that the sub-categories no longer exist either - so I want any references to the /category/village-voices/ category and any sub-categories, or posts within to go to /category/ooka-voices/ post listing.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic