• 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=France

    But I want it to be

    http://www.casinoupdate.co.uk/can-i-play-online-in-France

    The underlying URL of the page is

    http://www.casinoupdate.co.uk/?p=612&country=France

    I’ve written a mod-rewrite rule 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 .htaccess file; 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?

Viewing 2 replies - 1 through 2 (of 2 total)
  • I just ran into the same problem. I had to modify my htaccess file. This thread showed me how.

    So my finished htaccess file that now works for wordpress as well as other pages on my site looks like this.

    RewriteEngine On
    RewriteBase /
    #
    RewriteRule ^buy-(.*)-(.*)\.htm$ /morenow.php?title=$1&itemid=$2 [L]
    #
    # BEGIN WordPress
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    # END WordPress

    It wont let me post a link to thread I was refering to.

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

The topic ‘Adding conditional permalinks for special template pages’ is closed to new replies.