WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] URL Rewrite - Removing Permalink and reference to template (2 posts)

  1. PurpleGirl
    Member
    Posted 2 years ago #

    Really hope someone can help me. I'm tearing my hair out right now.

    I created a permalink in wordpress using rewrite rules
    [Code moderated as per the Forum Rules. Please use the pastebin]

    Everything was fine, until I made the fatal mistake of copying the 'product' template and saving it as the 'shop' template, forgetting to change the template name from 'product' to 'shop'. When I switched to the shop template it made no difference, the page still directs to the product template.

    If I navigate to http://my-site.com/shop - then the right shop template is displayed.

    But if I navigate to http://my-site.com/shop/store-name/brand-name/product-name -it shows the product template

    I've tried everything, I've disabled the cache plugin, deleted the page, deleted the template, removed the rule, changed the rule, deleted all references to the shop page in the interface, using the WordPress delete function and I even checked the database directly and all references were removed, yet when I use the 'my-site/shop/store-name/brand-name/product-name', the page is still being found.

    I even tried changing:

    $newrules['shop/([^/]+)/([^/]+)/([^/]+)?$'] = 'index.php?pagename=product&shop_name=$matches[1]&brand_name=$matches[2]&product_name=$matches[3]';

    to

    $newrules['shop/([^/]+)/([^/]+)/([^/]+)?$'] = 'index.php?pagename=product&shop=$matches[1]&brand=$matches[2]&product=$matches[3]';

    and that made no difference.

    I've searched high and wide for a solution and can't find one. I want to be able to use the shop page, and don't want to use another named page. Surely there must be a reference that can be deleted somewhere. Please can someone help...

    Thanks in advance

    PG

  2. PurpleGirl
    Member
    Posted 2 years ago #

    It seems that when the permalink uses the rewrite rule, somehow WordPress is rendering it as the product page

Topic Closed

This topic has been closed to new replies.

About this Topic