Temporary Redirection Plugin for Wordpress
When people visit His Story with URL www.wangxiaohu.com, I always want it automatically goes to wangxiaohu.com in order to be consistent. So I wrote this plugin for personal use.
It redirects the current URL to another URL with desired domain name. The source code is here:
The plugin first checks if HTTP_HOST equals $target_host (In my case, it’s “wangxiaohu.com“). If it doesn’t, the plugin simply replaces HTTP_HOST with $target_host and provides a 307 header for temporary redirection.
To install,
- Give $target_host a new value
- Rename the file to extension .php
- Upload it to Wordpress wp-content/plugins directory.
WARNING: This plugin is not guaranteed to be problem free. Use it at your own risk.
November 29th, 2006 at 5:03 am
这样的话貌似在htaccess定义了url 重写之后不行。。至少在我那儿不行。。
所以我就改用$_SERVER['REQUEST_URI']了。。。
November 29th, 2006 at 7:25 am
没看明白。啥意思?