Title: URL Redirection help
Last modified: August 20, 2016

---

# URL Redirection help

 *  [webscraper](https://wordpress.org/support/users/webscraper/)
 * (@webscraper)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/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)

 *  Thread Starter [webscraper](https://wordpress.org/support/users/webscraper/)
 * (@webscraper)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/url-redirection-help/#post-3498199)
 * 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.

 * 1 reply
 * 1 participant
 * Last reply from: [webscraper](https://wordpress.org/support/users/webscraper/)
 * Last activity: [13 years, 2 months ago](https://wordpress.org/support/topic/url-redirection-help/#post-3498199)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
