• Resolved tabasco86

    (@tabasco86)


    Hi,
    I just realized that my website isnt properly redirecting my product pages after I changed the product category.
    cormilu.com.br/loja/fios-de-luz/aspen-fio-de-luz/
    cormilu.com.br/loja/fio-de-luz/aspen-fio-de-luz/

    Both above links go to the same page.
    This is the case for all of my products. Is there a way to bulk redirect all pages that have the category fio-de-luz to their equivalent at fios-de-luz?

    thanks,
    Amir

    https://www.ads-software.com/plugins/quick-pagepost-redirect-plugin/

Viewing 8 replies - 1 through 8 (of 8 total)
  • Don Fischer

    (@prophecy2040)

    Amir,
    As long as the product slugs themselves have not changed, WordPress should automatically load the correct page even if the category name changed slightly. If you have the same products in different categories, then you may have an issue, but otherwise you should be fine.

    If you wanted to make sure the URLs redirected to the correct new category, you should probably look into doing it with an .htaccess redirect, as the plugin has no wildcard/bulk redirect functionality.

    Regards,
    Don

    Thread Starter tabasco86

    (@tabasco86)

    Thanks for your reply Don!
    I didnt actually know better and changed the slug… thought that had to be done.
    Do you think in terms of SEO this will cause any issues? (As it’s duplicate content)

    Do you have any idea how I can do the bulk redirect in htaccess? I’ve never done that before and am a bit worried about screwing up the site ??

    thanks,
    Amir

    Don Fischer

    (@prophecy2040)

    Amir,
    First, I want to state that I make no guarantees that this will work or is correct for your site/server, so please make a backup of your current .htaccess file first before you make changes. Second, not all hosts allow users to make changes to these file (most do), so you may need to contact your hosting provider if you cannot.

    That said, it SHOULD be as simple as adding the following to the top of your .htaccess file:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule ^loja/fio-de-luz/(.*)$ /loja/fio-de-luz/$1 [R=301,NC,L]
    </IfModule>

    If you do not know where the .htaccess file is located or how to modify it, there are a few plugins that allow you to modify it from your site admin.
    Here is a good one that may work well for you:
    https://www.ads-software.com/plugins/wp-htaccess-control/screenshots/

    Best of luck.
    Don

    Thread Starter tabasco86

    (@tabasco86)

    Hi Don,

    thanks for your fast reply. I have access to the htaccess file and will make a backup before editing.
    Quick question about your code before I get started.
    Shouldnt it in one of the cases have fios instead of fio?
    Basically I want all pages that currently have loja/fio-de-luz to redirect to their equivalent at loja/fios-de-luz.

    Thanks,
    Amir

    Don Fischer

    (@prophecy2040)

    You are correct – it should be :

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule ^loja/fio-de-luz/(.*)$ /loja/fios-de-luz/$1 [R=301,NC,L]
    </IfModule>

    That is what happens when you create code on the fly!

    Warm regards,
    Don

    Thread Starter tabasco86

    (@tabasco86)

    Hey Don,

    thanks a lot, your snippet worked perfectly!!

    Have a great day,
    Amir

    Thread Starter tabasco86

    (@tabasco86)

    Awesome Don,
    with this I was actually able to resolve several other webmaster 404’s caused by changing urls.
    Thanks a lot,
    Amir

    Don Fischer

    (@prophecy2040)

    Glad I could help!

    Warm regards,
    Don

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Bulk redirect of product pages’ is closed to new replies.