WordPress.org

Support

Support » Plugins and Hacks » URL Redirection help

URL Redirection help

  • I am making little plugin which just redirect one URL to another. My code is as given below

    add_action("init","redirect");
    
    function redirect()
    {
    add_rewrite_rule('^/this_is_url/$','another_url','top');
    flush_rewrite_rules();
    }

    I don’t know why this code is not working. Is there anything missing? Thanks.

Viewing 1 replies (of 1 total)
  • I have added below line as well to run plugin code when it activated.

    register_activation_hook(__FILE__,'redirect');

    But redirection still not working.

Viewing 1 replies (of 1 total)
  • The topic ‘URL Redirection help’ is closed to new replies.
Skip to toolbar