Pyblosxom Plugin Registry

Welcome to the Pyblosxom registry.

[ Submit new plugin | How to get help on plugins | Sorted by category | Sorted by date ]

rewrite

name: rewrite
author: Steven Armstrong
home page: http://www.c-area.ch/code/
download: http://www.c-area.ch/code/pyblosxom/plugins/
license:
category: headers
tags:
last edited: Aug 30, 2011 (Tuesday)

Request rewrite plugin. Similar to Apache mod_rewrite.

Sends a '301 Moved Permanently' status code allong with the new location of the resource.

Generates a simple html page with a meta-refresh and a link to the new resource as a fallback version for clients that do not understand http header redirects.

Configurable through a variable in config.py:

py['rewrite_rules'] = {
  '^/old$': r'/new', 
  '^/olddir/(.*)': r'/newdir/\1',
  '^/nothere/(.*)': r'http://www.example.com/here/it/is/\1'
}

Built with pyblosxom 1.5.2. Hosted by bluesock.org.