Page 1 of 1
Zeus Web Server Rewrite Rules
Posted: Fri Jun 19, 2009 11:55 am
by jtm-web
Hi I have two cmsms sites on an apache sever with the .htaccess file for mod rewrite given in the optional settings of the install documentation. Works perfectly, btw thanks all for making such a great CMS!
The web host is switching to Zeus Web Server and from what I understand they use a different format for rewriting urls. I've been searching for documentation that I can understand on how to implement this, but since I dont have access to a Zues setup yet, I'm not sure I can figure it out or test what I'm trying.
Does anyone know or have a working example of the rules required to have Zeus rewrite cmsms URLs in the format of:
http://www.domain.com/services/this-file-here.html?
Thanks in advance, and if I find anything out I'll update here.
JTM
edit: I found this thread
http://forum.cmsmadesimple.org/index.php/topic,16245.0.html and that code also in the drupal forum from a google search on the topic. Any confirmation that that works for cmsms?
Re: Zeus Web Server Rewirte Rules
Posted: Sat Jun 20, 2009 4:16 am
by viebig
My 1st try (not tested, but should work)
Let me know if it works for:
- Standard Pages
- News module pretty urls
- A real path on the server
Regards
G
Code: Select all
RULE_0_START:
# get the document root (think same as RewriteBase /)
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?page=%{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:
Re: Zeus Web Server Rewirte Rules
Posted: Sat Jun 20, 2009 9:06 am
by jtm-web
Thanks Viebig,
I can't try it just yet as the server these sites are on haven't been migrated yet. I'll contact the host on Monday because they are moving accounts who ask to be moved (but I wasn't one of them yet!!)
The sites I'm on don't use the news module right now, but when I move them I'll turn it on and test it to see if the rewrite rules work for the news and anything else I can think of.
As far as Zeus Servers go, do you have much experience with them? have you been happy with their performance?
The apache server these are on now aren't the best so I've been halfway looking forward to the migration and halfway dreading the unknown!!
Thanks Again,
JTM
Re: Zeus Web Server Rewirte Rules
Posted: Fri Oct 17, 2014 10:30 pm
by paulbaker
Even though it's 5 years old, viebig's code works (to some extent) on a client's Zeus hosting where I am attempting to set up pretty URLs.
http://www.example.co.uk/about
<-- works fine
http://www.example.co.uk/portfolio/literature
<-- works fine too.
However this URL from a CGBlog article doesn't work, instead I get the CMSMS error 404 page which I set up:
http://www.example.co.uk/2014/09/Lorem-Ipsum
I even tried without the 2014 and 09 but still didn't work:
http://www.example.co.uk/2014/Lorem-Ipsum
http://www.example.co.uk/Lorem-Ipsum
Any ideas on how I can get CGBlog pretty URLs to work with Zeus redirects?
Thanks

Re: Zeus Web Server Rewrite Rules
Posted: Sat Oct 18, 2014 4:33 am
by Rolf
It might be related to server time settings I have to look it up. Will post it later today.
Re: Zeus Web Server Rewrite Rules
Posted: Sat Oct 18, 2014 8:05 am
by Rolf
@Paulbaker
I had the same at my site a while ago. It was related to a time difference between the file and database server. Fixed it by adding into the config.php:
$config['timezone'] = 'Europe/Amsterdam';
$config['set_db_timezone'] = 'Europe/Amsterdam';
Change it for your time zone setting.
Re: Zeus Web Server Rewrite Rules
Posted: Sun Oct 19, 2014 8:55 pm
by paulbaker
Thanks Rolf, I added timezones for London but sadly this did not help the blog articles work with correct URLs. But thanks for the thought.