Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter codelizard

    (@codelizard)

    More information:

    I’ve been tracing this, and this is whats happening:

    I have an add_filter call for “template_include”, which is used to find which template I am using. This is how I send everything starting with “/vendors” to my own template for processing.

    Unfortunately, the URL is being redirected to the new one before the template_include call is made. Hence, skipping my vendor section.

    Still looking for help!

    Thread Starter codelizard

    (@codelizard)

    Ok, I finally figured out that this is a fruitless exercise. I tried changing the number of parms, so it wasnt the third parm and no matter what I did, it always ended up the same. So, instead of my URLS doing this:

    http://www.guitarnewsdaily.com/vendors/amps/yamaha/

    They now do this:

    http://www.guitarnewsdaily.com/vendors/amps/yamaha.html

    And they work great. I still wish I knew WHY it was doing the above, but I’ve now worked around it.

    Moderator keesiemeijer

    (@keesiemeijer)

    I have a custom section which is a vendors database

    Is this a custom post type or a taxonomy or something else?
    Can you show us your rewrite rules?

    Thread Starter codelizard

    (@codelizard)

    It is neither a custom post type nor taxonomy. I dont have any special rewrite rules in the .htaccess.

    I add a rewrite rule for this: ‘vendors(/?.*)?’ just so wordpress doesnt send me to the 404 page. Then, I use a filter for “template_include” where I check the URL. If the first section of the url is “vendors”, I then send them to my Vendors template.

    All of my work then happens in the vendors template.

    The issue seems to be if the url ends in “/”, and is not a direct hit on an existing url, it is doing a keyword search on the last parm in the string and redirecting to that article.

    By changing the way I do my URLS to end in “.html”, this no longer happens. I would still like an explanation, but for the moment this is working. I even just got done creating all of the 301 redirects for the 200+ urls I just changed.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Weird issue’ is closed to new replies.