I'm currently using Names.co.uk as a host for a few of my client's sites, and thought I'd post up a couple of bits of code which I'm using for 301 redirects, in the hope it saves people the time I've spent.

The code is quite a lot shorter than other examples I've seen. I'll add the caveat that this has been achieved by trial and error, and I've not got that much experience with Zeus. They work, but I can't vouch for security or error checking...

Namesco use a rewrite.script file, saved in the root directory of the website, as the functional equivalent of Apache's .htaccess file. I was migrating a site from .asp to .php and needed to organise a 301 redirect which kept the filename identical and the querystring intact - news.asp?NewsNo=500 mapped onto news.php?NewsNo=500

I did this with the following bit of script:
Code:
RULE_0_START:
# Rewrites URIs with .asp suffix to .php and preserves querystring values
match URL into $ with ^(.*)\.asp(.*)$
if not matched then goto RULE_0_END
if matched then
	set URL=$1.php$2
	set RESPONSE = 301
	set OUT:Location = %{URL}
	set BODY = Please try <a href="%{URL}">here</a> instead\n
goto END
RULE_0_END:
This became the basis of other rewrite scripts. For example, to redirect to a Flickr account photostream from a short URL (http://[www.domain.com]/flickr for example), I used:
Code:
RULE_1_START:
match URL into $ with ^\/flickr$
if not matched then goto RULE_1_END
if matched then
	set URL = http://www.flickr.com/photos/[name of photostream]/
	set RESPONSE = 301
	set OUT:Location = %{URL}
	set BODY = Please try <a href="%{URL}">here</a> instead\n
goto END
RULE_1_END:
Hope others find this helpful, as there didn't seem to be much in the way of real world examples that I could use as the basis for my needs.