Drupal and Zeus Rewrite
If you are reading this page, the chances are you are one of the lucky people to end up with hosting on a Zeus server rather than Apache so unable to use the Clean URLs out the box within Drupal due to it not supporting mod_rewrite. Below is the code you need to put in to a file called rewrite.script and to upload in to the root web folder of your hosting containing the site.
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’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:
Once you have uploaded this you can safely enable Clean URLs within your Drupal configuration. If you have installed Drupal in a subfolder simply alter the line
“set URL = /index.php?q=%{SCRATCH:REQUEST_URI}”
to
“set URL = /FOLDER-NAME/index.php?q=%{SCRATCH:REQUEST_URI}”
.
If you don’t want to go through the steps to try and get the rewrites working, or if your site uses features which are not supported by Zeus rewrites then you could move your site to a hosting company which has mod_rewrite. Fyrewire now offer combined hosting and site move service, so they move your site to their Apache servers which support mod_rewrite. To see the packages which support this click here.