views:

1157

answers:

1

Hi everyone,

I'm about to go live with a Codeigniter powered site. I want to remove index.php from the url so that instead of this:

http://www.mysite.com/index.php/controller

I get something like this:

http://www.mysite.com/controller

So far, pretty straightforward. In the past I've used the mod-rewrite rule supplied by the Codeigniter documentation:

RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

This works like a charm. However, for this site, I'm having to use a Zeus web server rather than Apache, and I'm not familiar with it at all. Zeus has its own rewrite rules such that this:

RewriteCond %{REQUEST_FILENAME} !-f  
RewriteRule ^[^/]*\.html$ index.php

would become this:

match URL into $ with ^/[^/]*\.html$
if matched then set URL = /index.php

Can anyone help me rewrite the first rule for Zeus? Any help very gratefully received!

+2  A: 

Figured it out - the following works nicely for me:

map path into SCRATCH:DOCROOT from /

set SCRATCH:ORIG_URL = %{URL}
set SCRATCH:REQUEST_URI = %{URL}

look for file at %{SCRATCH:DOCROOT}%{SCRATCH:REQUEST_URI}
if not exists then look for dir at %{SCRATCH:REQUEST_URI}%{SCRATCH:REQUEST_URI}
if not exists then set URL = /index.php%{SCRATCH:REQUEST_URI}
John McCollum