Quickly build your Zeus Server Script file

If your website is powered by a Zeus server then you may have found out that you can't handle redirects in the way that most people do (.htaccess). On Zeus Servers you need to create a rewrite.script file and use a different syntax to define the redirects. This tool will help you do that.

If you upgrade your website you will most likely have changed the path to the pages it contains. 301 Redirects are the best way to tell search engines and browsers that your pages have moved. This tool lets you enter the old and new pages which it converts into a Zeus Script that will perform the 301 Redirects you require.

Not using Zeus?
Then check out my article on how to do 301 redirects, which covers examples for other servers and languages.

Enter a comma or tab separated lists of old to new pages then click the generate button. Copy the resulting code into your rewrite.script file then see if the pages are redirecting as expected.

I find the simplest way to do this is to create an Excel file with two columns. Place the old pages in the first column and the new pages in the second column. Then just copy and paste the cells into the form below.

You only need to enter the path for each page and not the whole URL. e.g. about-us.htm. Just using paths means the rules generated are domain name independent. If you enter the full URL then the code generated will also take the domain into account. This way you can have the rule only apply to a single domain or have the redirect switch to a different domain.

Want to test your Redirects?
Then use my Redirect Header Checker to see what's happening.

An example list may look like this:

index.php?page=45, contact-us/
about-us.htm, about-us/
product-details.php?id=345, product/345/?view=details

The Zeus Server 301 Permanent Redirect Script Generator

Old to New Page List
Script

(If the rewrite.script file does not work then you may need to contact your hosting company and explain that you need the rewrite script engine to be turned on for your Zeus Server.)

What is it doing?

Here's an overview on what it does

If you specified a domain for the old page then this code will wrap the rest of the code. It checks that the old pages domain exactly matches the requesting domain (Host). The domain is written using Regular Expression (Regex) syntax.

insensitive match IN:Host into $ with ^domain\.com$
if matched
...
endif

insensitive indicates the Regex match should be case insensitive. IN: refers to HTTP Header variables from the Request.

Then this code checks that the path part of the page matches the request.

Some Regex Basics
^The start of a string
$The end of a string
\.Dots need escaping with a slash as they have a meaning (any character)
\+Plus needs escaping with a slash as it means "one or more" of the previous character
(.*)This indicates capture () zero or more * characters .
insensitive match URL into $ with ^/about-us\.htm$
if matched
...
endif

If you specified just a path for the destination page then the next lines are used. The fist line stores the host name in %1, and the second line sets the destination to the new page.

match IN:Host into % with ^(.*)$
set OUT:Location = http://%1/about-us/

OUT: refers to HTTP Header variables in the Response. 301 Redirects require that the Location variable is set to the URL of the new page.

If a full URL was specified for the new page then the code is simpler.

set OUT:Location = http://domain.com/about-us/

Finally settings are made to say it's an HTML page, we want a 301 Permanent Redirect , the response will contain the text "Moved" and this is the last command to execute.

set OUT:Content-Type = text/html
set RESPONSE = 301
set BODY = Moved
goto END

Help me improve it

If you spot any issues or have some ideas on how I can improve it, make a comment below or directly contact me . I'd love to hear from you.