So nice. After releasing my previous plugin (download counter for wordpress), I found out that I’ve put a wrong URL in the plugin’s comment. Therefor, a nice amount of hits found the wrong page for support. An empty page, that is. With only a download link to the latest version, but nothing else. My fault completely, of course.
Background
I wanted to create a redirection from that post to another post, but that doesn’t seem possible. Strange, since WordPress does have a redirection possibility; the permalink structure uses this, and my download counter uses this system also. However, adding or removing "normal" page url’s to this redirection facility is not built into the WordPress administration (or I couldn’t find it, of course).
Since I really required a redirection from /projects/wp-downloadcounter to the correct page, I’ve created this plugin for WordPress.
What does this plugin do
This plugin redirects a visitor who requests page A to page B. This visitor will be either redirected to page B, or WordPress will just show page B instead of page A. The difference between those two methods is that the first redirection is a so called external redirection, which uses the Location header and thus redirecting the browser to a new page. The second method just changes some internal variables, causing WordPress to show page A. In this case, the visitor has no idea that you’ve just redirected him.
Why should I use this?
When you’ve just been as stupid as I am
Or when you want your posts to be accessible trough different URL’s. Or… (fill it out yourself).
Installation
Download the zip-file and extract the wp-redirect directory to you wp-content/plugins directory. Go to the plugins page in your wordpress administration panel, and Activate the Redirect plugin. On Activation, a table with the name [$prefix]redirect gets created. The table will not be removed when deactivating the plugin!
Management
After activation, a new page will appear in the Management tab. Choose Management -> Redirect for the redirection screen. Click on Add Redirection to add a new redirection. Enter the url which needs redirecting in the source field, and the redirected url in the destination field. Finally, choose the type of redirection.
If you’ve entered another host as the destination field, the redirection will always be externally.
Downloading
You can download the plugin here.
Note
This plugin is only tested on WordPress 2.2 and 2.3. Adam let me know that this plugin does not work with WordPress 2.0. He found another plugin doing the same thing for the WordPress 1.5 and 2.0 codebase. You can find that plugin here.
I think I will try this plugin with my blogs, cause I need redirection for some pages!
Thanks for the plugin!
Hi,
I tried using this on my site running Wordpress 2.0.2 but got the following error message on the Redirect Manage page:
Fatal error: Call to undefined function: wp_nonce_url() in /home/price/www/www/wp-content/plugins/wp-redirect/redirect-options.php on line 137
Can you give a quick example of using this plugin? I assumed you meant:
take this:
http://www.mysite.com/wp-admin
to this:
http://www.mysite.com/wp-content
If I set this as the feature it does nothing. Am I misunderstanding?
@Doc4: That is what it should do, however, only on non-existing content. Since the wp-admin directory exists, the index.php script inside that directory will execute, instead of the index.php in the root. The index.php inside the wp-admin directory does not execute plug-ins the same way as the rooted index.php would. The thing you want to do should be configured using rewrite rules or another plug-in which executes this kind of redirect even when you’re in the administration section.