Posted: July 30th, 2008
Zeus Webserver 301 Permanent Redirect non-www to www site

I have just been on a long and winding journey of web pages with Zeus codes that just didn’t work for me. At least for now I am at the end and have a working rewrite.script that redirects all non-www pages to their www counterparts. To apply the following:
- Copy and paste the code shown below into a file named rewrite.script
- Replace example.co.uk with your own site
- Upload to the root directory of your site
- Try out the redirect yourself in a browser
- User a HTML Server Response checker to make sure all is ok
Below is the code, which should not be changed with the exception of the domain name and be sure to escape the . with a \ in line 2 e.g. example\.com, example\.co\.uk:
1 2 3 4 5 6 7 8 9 10 11 | RULE_0_START:
match IN:Host into $ with ^example\.co\.uk$
if matched then
match URL into $ with ^/(.*)$
set OUT:Location = http://www.example.co.uk/$1
set OUT:Content-Type = text/html
set RESPONSE = 301
set BODY = Moved
goto END
endif
RULE_0_END: |
If you find this code useful or even find it doesn’t work for you, then please let me know. You can now combine this with our free HTTP Server Response tool to check your 301 Redirect is working as it should.
Share this post:










Haha nice! At last some decent code for global redirects on Zeus, been looking everywhere on the net.
Thanks a lot, it work for me hehe, used it on destinationmalta(.)com
We are redesigning whole website and wanted to make sure we got non-www in order first!
One small thing, if I want to redirect (as well) just 1 old url to a new one, may I ask for some help here too?
Thanks a million
Great and hope it helps. I do have a script that I was in the process of trying out that does a Zeus permanent redirect the main index page to the root (and vice versa). I will dig it out for you as it appears to work well and could easily be tweaked for your website.
James
Hi Mark, you should be able to try something like this code appended after your original rule:
RULE_1_START:
match URL into $ with ^\/oldpage.html$
if matched then
set OUT:Location = http://www.example.co.uk/newpage.html
set OUT:Content-Type = text/html
set RESPONSE = 301
set BODY = Moved
goto END
endif
RULE_1_END:
Please let me know if it works and it may ease a few others headaches.
I tried the latest script to redirect language.htm (from same domain mentioned above) to learn-english-malta.htm
Haha it works too
Great thanks mate, it’s almost fun now!
Maybe Zeus isn’t so bad after all!
Glad to help out and also glad to have my own redirects working after so much messing around!
i have a wordpress blog on zeus server, and i am not able to make out how to get the permlinks working. i am in urgent need of it. please help me out with it.
If you Google “zeus mod rewrite wordpress”, result number 1 has a savagely sized rewrite script that might help you.
I checked “zeus mod rewrite wordpress” on Google and sent me back here. I too was looking forward to make wordpress permalinks work, maybe you can help us out.
Haha seems you’re the only pro around
I searched for exact match with “…”, without managed to find something now, will give it a try later
Hi Mark,
I have not tried much with WordPress, though have got things working for my own custom builds with the same script, so pretty sure it should be okay. You can see it on a post of mine here.
James