Support Centre

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  
##### FIX TO ALLOW SEARCH TO WORK #####  
match URL into $ with ^/(.*)  
set URL = /index.php/$1

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.

Wordpress MultiSite is now a part of the Wordpress project itself, and can host multiple blogs (see http://mu.wordpress.org for information)

If you have configured Wordpress to run as a multisite version, you will need to use this rewrite script instead of the one above

#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   
match URL into $ with ^/blog/([_0-9a-zA-Z-]+/)?files/(.+)   
if matched then   
        set URL=/blog/wp-includes/ms-files.php?file=$2   
        goto END   
endif   
match URL into $ with ^/blog/([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes|login).*)   
if matched then   
        set URL=/blog/$2   
        goto END   
endif   
match URL into $ with ^/blog/([_0-9a-zA-Z-]+/)?(.*\.php)$   
if matched then   
        set URL=/blog/$2   
endif   
match URL into $ with ^/blog/(.*)   
if matched then   
        set URL=/blog/index.php   
        goto END   
endif

Rate This Article

How useful was this article?

Not useful A little useful Useful Very useful Everything I needed  
Free

Online Business Training

  • Get more out of Google AdWords
  • Optimise your website for Search Engines
  • Use Social Media to generate more customers

'Like' us on Facebook to get access to FREE Online Bussiness Training!