Title: Weird issue
Last modified: August 21, 2016

---

# Weird issue

 *  [codelizard](https://wordpress.org/support/users/codelizard/)
 * (@codelizard)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/weird-issue-2/)
 * Ok I had this issue once before, and I THOUGHT I had posted about it, but here
   it is again and I can find no reference to the solution.
 * So I run a wordpress site: www guitars news daily .com.
 * I’m having a URL issue.
 * I have a custom section which is a vendors database:
 * [http://www.guitarnewsdaily.com/vendors/](http://www.guitarnewsdaily.com/vendors/)
 * This is a plugin system using the “generate rewrite rules” to add a new rule.
   Any URL that starts with “/vendors/” is sent to my plugin to handle. This works
   99 times out of 100. However, this is not always the case.
 * For example, this URL:
 * [http://www.guitarnewsdaily.com/vendors/amps/yamaha/](http://www.guitarnewsdaily.com/vendors/amps/yamaha/)
 * skips my plugin, and instead redirects to:
 * [http://www.guitarnewsdaily.com/2010/09/yamaha-introduces-james-toseland-signature-guitar/](http://www.guitarnewsdaily.com/2010/09/yamaha-introduces-james-toseland-signature-guitar/)
 * If I change one letter:
 * [http://www.guitarnewsdaily.com/vendors/amps/yemaha/](http://www.guitarnewsdaily.com/vendors/amps/yemaha/)
 * My plugin catches it. If I remove the “maha” from the above example, it redirects
   here:
 * [http://www.guitarnewsdaily.com/2010/06/yes-toto-yoso-no-really/](http://www.guitarnewsdaily.com/2010/06/yes-toto-yoso-no-really/)
 * It seems like it is taking my third parm, and doing a keyword search on it.
 * Can anyone shed some light on this and tell me how to make it stop? I want all
   urls starting with “/vendors” to go to my plugin, end of story. Not only if the
   third parm is not a wildcard match.
 * Any assistance would be appreciated.

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

 *  Thread Starter [codelizard](https://wordpress.org/support/users/codelizard/)
 * (@codelizard)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/weird-issue-2/#post-3872497)
 * 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](https://wordpress.org/support/users/codelizard/)
 * (@codelizard)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/weird-issue-2/#post-3872520)
 * 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/](http://www.guitarnewsdaily.com/vendors/amps/yamaha/)
 * They now do this:
 * [http://www.guitarnewsdaily.com/vendors/amps/yamaha.html](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](https://wordpress.org/support/users/keesiemeijer/)
 * (@keesiemeijer)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/weird-issue-2/#post-3872540)
 * > 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](https://wordpress.org/support/users/codelizard/)
 * (@codelizard)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/weird-issue-2/#post-3872556)
 * 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.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 2 participants
 * Last reply from: [codelizard](https://wordpress.org/support/users/codelizard/)
 * Last activity: [12 years, 10 months ago](https://wordpress.org/support/topic/weird-issue-2/#post-3872556)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
