Zeus Web Server Rewrite Rules

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
jtm-web
New Member
New Member
Posts: 3
Joined: Fri Jun 19, 2009 10:16 am

Zeus Web Server Rewrite Rules

Post 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?
Last edited by jtm-web on Fri Jun 19, 2009 12:08 pm, edited 1 time in total.
viebig

Re: Zeus Web Server Rewirte Rules

Post 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:
jtm-web
New Member
New Member
Posts: 3
Joined: Fri Jun 19, 2009 10:16 am

Re: Zeus Web Server Rewirte Rules

Post 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
User avatar
paulbaker
Dev Team Member
Dev Team Member
Posts: 1465
Joined: Sat Apr 18, 2009 10:09 pm
Contact:

Re: Zeus Web Server Rewirte Rules

Post 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 ;D
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: Zeus Web Server Rewrite Rules

Post by Rolf »

It might be related to server time settings I have to look it up. Will post it later today.
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: Zeus Web Server Rewrite Rules

Post 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.
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
User avatar
paulbaker
Dev Team Member
Dev Team Member
Posts: 1465
Joined: Sat Apr 18, 2009 10:09 pm
Contact:

Re: Zeus Web Server Rewrite Rules

Post 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.
Post Reply

Return to “CMSMS Core”