• Resolved skinnybloke

    (@skinnybloke)


    Hi – I want to modify my permalinks so that:

    https://www.handinglove.co.uk/music-playlist/?artist=Grimes&album=Visions&track=Genesis

    redirects to

    https://www.handinglove.co.uk/Grimes/Visions/Genesis

    I have added this to my functions.php

    function custom_rewrite_basic() {
      add_rewrite_rule('([^/]*)/([^/]*)/([^/]*)$', 'music-playlist/?artist=$1&album=$2&track=$3', 'bottom');
    }
    add_action('init', 'custom_rewrite_basic');

    but it gives me a page not found.

    I have checked my .htaccess file and the code has been included as:

    RewriteRule ^([^/]*)/([^/]*)/([^/]*)$ /music-playlist/?artist=$1&album=$2&track=$3 [QSA,L]

    What have I done wrong?

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Help needed with permalinks and add_rewrite_rule’ is closed to new replies.