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.

In Wordpress I have a template (lets call it template.php) that has content on the following page:


This page should be able to handle URL-parameters like. I got this to work.


But I really want the URL to be pretty like this


I have the following in my .htaccess-file:

RewriteRule ^template/country-is-([^/]+)-and-city-is-([^/]+)?$ /template?country=$1&city=$2 [L]

But this just gives a 404-page, and I think that Wordpress thinks this is a blog post (which is it not).

I got this to work in flat files outside Wordpress - but I know there are loads of URL-rules in Wordpress and somehow things clash.

Can anybody help me achieve this?

Thank you.

share|improve this question

Your Answer


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

Browse other questions tagged or ask your own question.