Adding conditional permalinks for special template pages
-
I’m happy with canonical permalinks for all the pages which show ordinary posts, but as part of my wrodpress set-up I have a PHP-based tool an an alternative template which takes text entered into a form and calls out data from a MySQL database to present via a results page.
Currently, the URL showing is
http://www.casinoupdate.co.uk/country-results/?country=FranceBut I want it to be
http://www.casinoupdate.co.uk/can-i-play-online-in-FranceThe underlying URL of the page is
http://www.casinoupdate.co.uk/?p=612&country=FranceI’ve written a
mod-rewriterule which should make this change …RewriteRule ^can-i-play-online-in-([A-Za-z0-9-]+)/ http://www.casinoupdate.co.uk/?p=612&country=$1 [NC,L]and placed it into the
.htaccessfile; however, WordPress simply ignores it giving me a 404 error every time, no matter where the rule is placed.I’ve checked all the obvious bugs, turned the file permissions off and back on again, examined the code using AskApache RewriteRules Viewer, and even tried to debug it by using obviously bad code which *should* fail.
Time and again, I simply get a 404 error for the URL typed in while the permalinks on the rest of the site are unaffected.
Is it possible to add alternative rewrite rules to WordPress?
And if so, how?
The topic ‘Adding conditional permalinks for special template pages’ is closed to new replies.