Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Currently, i have working with a Zeus server and we have a website which is developed using Wordpress. Zeus Sever don't support the .htaccess file which is required to install wordpress and also for the SEO. however, there is another way we can manage Zeus to achieve our tasks by defining some rewrite rules.

For WordPress we are currently Using the following Rewrite rules:

RULE_0_START:

# get the document root

map path into SCRATCH:DOCROOT from /
# initialize our variables
set SCRATCH:ORIG_URL = %{URL}
set SCRATCH:REQUEST_URI = %{URL}

# see if theres any queries in our URL
match URL into $ with ^(.*)\?(.*)$
if matched then
set SCRATCH:REQUEST_URI = $1
set SCRATCH:QUERY_STRING = $2
endif
RULE_0_END:

RULE_1_START:
# prepare to search for file, rewrite if its not found
set SCRATCH:REQUEST_FILENAME = %{SCRATCH:DOCROOT}
set SCRATCH:REQUEST_FILENAME . %{SCRATCH:REQUEST_URI}

# check to see if the file requested is an actual file or
# a directory with possibly an index. don?EUR(TM)t rewrite if so
look for file at %{SCRATCH:REQUEST_FILENAME}
if not exists then
look for dir at %{SCRATCH:REQUEST_FILENAME}
if not exists then
set URL = /index.php?q=%{SCRATCH:REQUEST_URI}
goto QSA_RULE_START
endif
endif

# if we made it here then its a file or dir and no rewrite
goto END
RULE_1_END:

QSA_RULE_START:
# append the query string if there was one originally
# the same as [QSA,L] for apache
match SCRATCH:ORIG_URL into % with \?(.*)$
if matched then
set URL = %{URL}&%{SCRATCH:QUERY_STRING}
endif
goto END
QSA_RULE_END:

need a sub domain for our project:

Our hosting service provider "netregistry.com.au" is not based on Cpanel which makes our job harder to setup a Subdomain. Netregistry provide a tutorial which guide us to setup the subdomain.

http://www.netregistry.com.au/support/articles/create-a-subdomain-to-point-to-a-directory

however, to make the subdomain work we need to add some rewrite rule for the server Zeus.

The following rewrite rule we need to add:

RULE_1_START:
insensitive match IN:Host into % with ^www.example.com.au
if  matched then goto END
RULE_1_END:

RULE_2_START:
insensitive  match IN:Host into % with ^(.*).example.com.au
if matched then match URL  into $ with ^/(.*)
if not matched then goto RULE_2_END
set URL =  /%1/$1
RULE_2_END:

problem is we already have written rule 1 for the Wordpress. and if we place rule 1 again server will irnore the rule 1. Anyone have any idea how we can combine rewrite rules?

Please help us to combine WordPress and subdomain rewrite rule together

share|improve this question

closed as off topic by Michael Hampton, John Gardeniers, Ward, mdpc, HopelessN00b Dec 5 '12 at 0:30

Questions on Server Fault are expected to relate to server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

    
Zeus Web Server no longer seems to be actively maintained, and parts of their web site appear broken. You may find it a good idea to switch to something else in the near future. –  Michael Hampton Nov 23 '12 at 11:49

1 Answer 1

I have fixed it!! I had this issue too. I just learn a little bit more about the zeus rules and create my own combination. Check my solution for the subdomain and wp in the root site:


RULE_3_START:
insensitive match IN:Host into % with ^www.myexample.com
if  matched then goto RULE_2_END
RULE_3_END:

RULE_2_START:
insensitive  match IN:Host into % with ^(.*).myexample.com
if matched then match URL  into $ with ^/(.*)
if not matched then goto RULE_2_END
set URL =  /%1/$1
RULE_2_END:


RULE_0_START:
# get the document root
map path into SCRATCH:DOCROOT from /
# initialize our variables
set SCRATCH:ORIG_URL = %{URL}
set SCRATCH:REQUEST_URI = %{URL}

# see if theres any queries in our URL
match URL into $ with ^(.*)\?(.*)$
if matched then
set SCRATCH:REQUEST_URI = $1
set SCRATCH:QUERY_STRING = $2
endif
RULE_0_END:

RULE_1_START:
# prepare to search for file, rewrite if its not found
set SCRATCH:REQUEST_FILENAME = %{SCRATCH:DOCROOT}
set SCRATCH:REQUEST_FILENAME . %{SCRATCH:REQUEST_URI}

# check to see if the file requested is an actual file or
# a directory with possibly an index. don?EUR(TM)t rewrite if so
look for file at %{SCRATCH:REQUEST_FILENAME}
if not exists then
look for dir at %{SCRATCH:REQUEST_FILENAME}
if not exists then
set URL = /index.php?q=%{SCRATCH:REQUEST_URI}
goto QSA_RULE_START
endif
endif

# if we made it here then its a file or dir and no rewrite
goto END
RULE_1_END:

QSA_RULE_START:
# append the query string if there was one originally
# the same as [QSA,L] for apache
match SCRATCH:ORIG_URL into % with \?(.*)$
if matched then
set URL = %{URL}&%{SCRATCH:QUERY_STRING}
endif
goto END
QSA_RULE_END:

The rules names don't are required use the same that the server example, just is needed that your rules have the correct relation. I Hope this solution can be useful.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.