• First let me say.. this is the best plugin for wordpress. It can do so many things and keep them easy to manage. its a life saver.

    I would like to ask a (maybe) very basic question.

    I am trying to add the following code snippet to rewrite the url from mysite/p/abc to mysite/index.phd?p=abc. But this doesnt seem to work even after resaving the mysite/wp-admin/options-permalink.php again and again.. What am I missing here?
    Thanks.

    add_action( ‘init’, ‘my20_rewrite’,99 );
    function my20_rewrite()
    {
    add_rewrite_rule(
    ‘^p/([^/]*)/?$’,
    ‘index.php?p=$matches[1]’,
    ‘top’
    );
    }

  • The topic ‘URL rewrite using code-snippets’ is closed to new replies.