[TYPO3] static File Cache / redirect into cache directoy

Michiel Roos michiel at netcreators.com
Fri Jun 27 10:51:45 CEST 2008


FORMER 03 | Florian Schupp schreef:
> Hi guys,
> I'm using the extension "static File Cache" and it works fine for me on
> several installations, but one server keeps redirecting users into the
> cache dirctory!
> 
> http://typo3.org/extensions/repository/view/nc_staticfilecache/2.3.1/
> 
> If you go to http://www.pinsker.de
> 
> You will be redirected to (not right now!)
> http://www.pinsker.de/typo3temp/tx_ncstaticfilecache/www.pinsker.de/index.php/
> 
> 
> At least it's what happens to me. In my .htaccess file I use:
> 
> RewriteCond
> %{DOCUMENT_ROOT}/typo3temp/tx_ncstaticfilecache/%{HTTP_HOST}/%{REQUEST_URI}index.html
> -f
> RewriteRule .*
> typo3temp/tx_ncstaticfilecache/%{HTTP_HOST}/%{REQUEST_URI} [L]

Hello again,

:-)

You can switch on mod_rewrite debugging for a start. To do this you need
access to your apache config. You add these two lines somewhere:

RewriteLog "/var/www/apache/mod_rewrite.log"
RewriteLogLevel 4

Then you can restart apache, open a terminal and tail the log using:

tail -f /var/www/apache/mod_rewrite.log

You should see log messages scrolling by explaining what mod rewrite is
actually rewriting and to where. This may help debugging.

I don't know what kind of setup you have for your rewriting rules. I
changed my rewriting rules a couple of days ago to live in my vhost.
This showed me (by looking at the rewrite logs) that the rewriting
sometimes fails in that case because of a double slash. I changed these
lines:

RewriteCond
%{DOCUMENT_ROOT}/typo3temp/tx_ncstaticfilecache/%{HTTP_HOST}/%{REQUEST_URI}index.html
-f
RewriteRule .*
/typo3temp/tx_ncstaticfilecache/%{HTTP_HOST}/%{REQUEST_URI} [PT]

Into these:

RewriteCond
%{DOCUMENT_ROOT}/typo3temp/tx_ncstaticfilecache/%{HTTP_HOST}%{REQUEST_URI}index.html
-f
RewriteRule .*
/typo3temp/tx_ncstaticfilecache/%{HTTP_HOST}%{REQUEST_URI} [PT]

(remove the slash beteween HTTP_HOST and REQUEST_URI)

Also I notices that mod rewrite rewrote my path requests to the default
index file. In my case this was set to index.htm. In some other cases it
is set to index.php. But the index files written by staticfilecache end
in html.

So I had to adjust:

DirectoryIndex index.htm index.html index.php

to read:

DirectoryIndex index.html index.php index.htm

I put index.htm in the back since it is the one that is used least often.

Also I notices a difference in using the [L] with mod_rewrite as opposed
to the [PT]. They mean 'last' and 'passthrough' respectively. Experiment
with that.

I hope this helps. If not, give me som more info.

Good luck!

:-)

Kind regards,


Michiel Roos

-- 
Netcreators BV :: creation and innovation
www.netcreators.com

Interesse in werken bij Netcreators?
http://www.netcreators.com/bedrijf/vacatures/


More information about the TYPO3-english mailing list