Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am using a fantastic plugin called Query Multiple Taxonomies which provides a widget to "drill down" by category / tag and other custom taxonomies you may have.

The site is livetonom.com.

The widget (on the sidebar) gives URLS ending:

/?category_name=restaurants&locations=london

Is it possible to rewrite that to something like:

/restaurants/london

I tried using a rewrite rule generators but stuff like this added directly to .htaccess did not work:

    RewriteEngine On
    RewriteRule ^([^/]*)/([^/]*)$ /?category_name=$1&locations=$2 [L]

I'm not even sure that adding to .htaccess directly is correct or will work - can anyone let me know if this is a non-starter or how I go about this?

share|improve this question
    
Well, maybe we should see what @scribu has to say... –  Tom Auger Jul 17 '12 at 20:14
add comment

1 Answer

I think you are on the right track with .htaccess and rewrite rules

What you might consider is a 301 redirect in your .htaccess like this

#fancy name redirect here
redirectMatch 301 ^/restaurant/london(.*)$ /?category_name=restaurants&locations=london

Basically you can then tell people to go to your own friendly URL and they get redirected to the longer one that WordPress uses.

I'd have a look at Perishable Press stupid tricks with .htaccess

As another point of reference you can use go to WordPress Admin > Settings > Permalinks and change the word Category to Restaurants -- but that will mean all your 'categories' are now 'restaurants'

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.