Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

anyone88 on "Add a custom url rewrite rule to wordpress"

$
0
0

Hi wordpresscommunity,

I'am trying to add a custom URL rewrite to my wordpress-site. When %25% is in located in the url, I want to forward to index.php (dont ask me why ;)). The correct rewrite I stumbled across is:

add_rewrite_rule('^(.)%25%(.)$','index.php', 'top');

I red that the url rewrite has to be added as a plugin. My plugin looks like this:

<?php
/**
* Plugin Name: Custom url rewrite
* Plugin URI: http://URI_Of_Page_Describing_Plugin_and_Updates
* Description: custom url rewrite
* Version: 1.0
* Author: Henk
* Author URI: http://URI_Of_The_Plugin_Author
* License: GPL2
*/
function init() {
add_rewrite_rule('^(.)%25%(.)$','index.php', 'top');}

It doesn't do anything after being activated! not even after flushing my url rewrites. What do I do wrong?

Thanks!


Viewing all articles
Browse latest Browse all 8245

Trending Articles