[ic] Getting rid of /cgi-bin/scriptname

Frederic Steinfels interchange-users@icdevgroup.org
Mon Mar 17 14:59:01 2003


Rene Hertell wrote:

>>For those who are interested in removing /cgi-bin/catalogname from the url
>>string, this is the solution:
>>
>>In your apache configuration file, insert the following lines for your
>>virtualsever and secure virtualserver:
>>    
>>
>
>...
>
>I would suggest that you should this snippet to the documentation WIKI.
>
>I just tested this, and it seems to work really nice! :-)
>
>Thanks for this excellent code!
>
>  
>
Thank you

In the meantime I found a few new rules that you should put in:

    RewriteEngine   On

    RewriteRule     ^/error/(.+)$       -       [L,NS]
    RewriteRule     ^/images/(.+)$       -       [L,NS]

    RewriteRule     ^$      /cgi-bin/shop/mods.html  [L,NS,PT]
    RewriteRule     ^/$      /cgi-bin/shop/mods.html  [L,NS,PT]
    RewriteRule     ^/index\.html$      /cgi-bin/shop/mods.html  [L,NS,PT]

    RewriteCond     /home/shop/www/html/%{REQUEST_FILENAME} -f      [OR]
    RewriteCond     /home/shop/www/html/%{REQUEST_FILENAME} -d
    RewriteRule     ^(.+)$  -       [L,NS]

    RewriteCond     /%{REQUEST_FILENAME}    !^.*/cgi-bin/shop.*$
    RewriteRule     ^(.+)$  /cgi-bin/shop/$1  [L,NS,PT]


Basically the one with 'error' in it will make sure server error 
messages do not get forwarded
to interchange (resulting in a potential endless loop).

Furthermore hard-wiring the images is suggested; a lot of people forget 
to put in all pictures needed.

I will put it into wiki soon...

Frederic