Search for your answers

Wordpress Rewrite Script

5*5*5*5*5*

Article

Unfortunately, mod_rewrite is not available on our hosting packages as this is a module for Apache servers and we run Zeus. We do however, offer an alternative, more powerful rewrite facility on all of our Linux hosting packages.

The Zeus Rewrite functionality works in a similar way but has a slightly different syntax. Simply create a file called 'rewrite.script' in your web directory and enter your rewrite rules.

#Zeus webserver version of basic Wordpress mod_rewrite rules           
map path into SCRATCH:path from %{URL}           
look for file at %{SCRATCH:path}           
if exists then goto END           
look for dir at %{SCRATCH:path}           
if exists then goto END           
##### FIX FOR LOGIN/FORGOTTEN PASSWORD/ADMIN ETC #####           
match URL into $ with ^/wp-.*$           
if matched then goto END           
set URL = /index.php

If your Wordpress installation is stored in a directory other than the /web directory, for example, if your Wordpress installation can be found at http://www.yourdomain.com/blog you will need to use a slightly different rewrite script.

#Zeus webserver version of basic Wordpress mod_rewrite rules
map path into SCRATCH:path from %{URL}
look for file at %{SCRATCH:path}
if exists then goto END
look for dir at %{SCRATCH:path}
if exists then goto END
##### FIX FOR LOGIN/FORGOTTEN PASSWORD/ADMIN ETC #####
match URL into $ with ^/blog/wp-.*$
if matched then goto END
##### FIX TO ALLOW SEARCH TO WORK #####
match URL into $ with ^/blog/(.*)
set URL = /blog/index.php/$1

The above script rewrites the /blog directory - If your Wordpress installation is in a different directory, replace any instance of /blog with that of the correct directory name.

Rate This Article

How useful was this article?

Not useful A little useful Useful Very useful Everything I needed