durusmail: quixote-users: Rewrite rule
Rewrite rule
2004-01-06
Rewrite rule
Christoph Devenoges
2004-01-06

++ Ksenia wrote on Tue, Jan 06, 2004 at 11:44:42AM +0100 :
>
> I'd like to redirect requests to / (siteroot) to the directory
> /cgi-bin/index.cgi. I can't get it to work. Here is a part of my VirtualHost
> directive (Apache 2):

this works for me (in .htaccess in root of webspace)

RewriteEngine on
RewriteBase   /

# allow static files to be served
RewriteCond %{REQUEST_URI} !^.*\.(gif|jpg|css|wav|avi|mpg|pdf|txt|html|js|swf)$
[NC]
# prevent looping
RewriteCond %{REQUEST_URI} !^/py.cgi(.*)$ [NC]
# prefixes handled by py.cgi, index is also served by py.cgi
RewriteCond %{REQUEST_URI} ^/(plog|sculpture|photos|links|quotes|cv).*$ [OR]
RewriteCond %{REQUEST_URI} ^/$ [NC]
# all remaning requests get py.cgi prepended
RewriteRule ^(.*)$  /py.cgi/$1 [L]


im shure a mod_rewrite expert could optimize this somewhat. for more
hints download the quixote users mailing list archive and grep for
RewriteCond or RewriteRule, there have been several threads on this
subject in the past.

kind regards
chris


--
The water was not fit to drink. To make it palatable, we had to add
whiskey. By diligent effort, I learned to like it.
    -- Winston Churchill

http://devenoges.com/plog/  : photographic weblog (made with quixote)


reply