[ic] Re: rewite rules killed images

interchange-users@icdevgroup.org interchange-users@icdevgroup.org
Sat Sep 21 16:46:01 2002


DB writes: 

> I tried using the rewrite rules which I found on the archives (see below). 
> It worked well, but all of my images were gone. Does anyone know why 
> offhand? I'm new at this rewrite stuff. 
> 
> 
>> <VirtualHost my.virtual.ip.address>
>>     # standard virtual domain stuff goes here
>>     ...
>>     # set directory path to the cgi-bin directory for this domain
>>     # (in this case, it's the same as the system cgi-bin directory
>>     ScriptAlias /cgi-bin/ "/home/httpd/cgi-bin/"
>>     # rewrite external URLs to internal pathnames
>>     # Note that the [PT] (Pass Thru) flag is used to let the
>>     # /cgi-bin/ part of the replacement string to be evaluated by
>>     # by the ScriptAlias rule. Alternatively, we could just put
>>     # the complete directory path in there, but the former is
>>     # more portable.
>>     RewriteEngine On
>>     # comment out the next two rewrite rules if you want to have
>>     # a splash page prior to going to the home page for this catalog
>>     # matches on http://myhost.com
>>     RewriteRule ^$              /cgi-bin/store/index.html        [PT,L]
>>     # matches on http://myhost.com/
>>     RewriteRule ^/$             /cgi-bin/store/index.html        [PT,L]
>>     # don't change URLs like http://myhost.com/cgi-bin/store/*
>>     RewriteRule ^/cgi-bin/store/.*       -                       [PT,L]
>>     # default rule change http://myhost.com/somepage to
>>     # /cgi-bin/store/somepage
>>     RewriteRule ^/(.*)          /cgi-bin/store/$1                [PT,L]

This rule applies to almost anything. You need to add an Alias
_above_ it for your images, e.g. 

Alias /images/  /home/myhost/images/ 

The same goes for robots.txt, favicon.ico etc. 

Ciao
     Racke 

 

 

-- 
Prolific Interchange Consulting (Excellent German Quality !).
Take a look at Materialboerse (http://www.materialboerse.de/), WITT
(http://www.witt-weiden.de/), Boxmover (http://shop.boxmover.ch/) or
Passionshop (http://www.passionshop.com/racke). Need a shop ? Contact us.