1

Looking for a little help with Zeus Rewrite.Script for multiple directories - I have a working script that operates in I place Wordpress in a sub-directory - however, If I want to run another Wordpress installation in another directory I can't get the rewrite to work with this too. Any help would be greatly appreciated!

My rewrite for 1 directory;-

#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 ^/site1/wp-.*$
if matched then goto END
##### FIX TO ALLOW SEARCH TO WORK #####
match URL into $ with ^/oxford-walking-tours/(.*)
set URL = /site1/index.php/$1

So site1 in the first directory - can anyone suggest how I can make this work for site2 as well?

Thanks

Ben21
  • 35
  • 6

1 Answers1

0

The script below is one that may help all ZEUS server redirecting It ignores the folder called myfolder (replace this with one you want to exclude from any redirect, you can still get to it.)

And the rest of the file redirects to the .com version of the website in www form (rule2) and without www (rule1).

Save the file as rewrite.script and upload to root directory of server.

#ignore anything to do with myfolder
match URL into $ with ^/myfolder(\/)?.*
if matched then goto END


RULE_1_START:
match IN:Host into $ with ^mywebsite\.net$             
if matched then            
match URL into $ with ^/(.*)$             
if matched then            
set OUT:Location  = http://www.mywebsite.com/$1             
set OUT:Content-Type = text/html             
set RESPONSE = 301             
set BODY = Moved             
endif             
endif
RULE_1_END:

RULE_2_START:
match IN:Host into $ with ^www.\mywebsite\.net$             
if matched then            
match URL into $ with ^/(.*)$             
if matched then            
set OUT:Location  = http://www.mywebsite.com/$1             
set OUT:Content-Type = text/html             
set RESPONSE = 301             
set BODY = Moved             
 endif       
endif
RULE_2_END:
Mikeys4u
  • 1,494
  • 18
  • 26