vhost conf for typo3
hostis.pl
hostis.pl at gmail.com
Wed Mar 25 13:07:10 MSK 2009
Hi all,
i have little problem with setting rewrite rules for directories like
typo3. I can access to typo3 admin panel. Site works almost perfectly
with one exception.
When i pass url like http://domain/typo3/sysext/noborder.html (this file
dosen't exist) it should send back 404 error.
But i get rendered main page with html content and without any styles,
images, etc.
i try to do it by my own but it dosen't work good.
here is .htaccess rewrite rules:
# Stop rewrite processing if we are in the typo3/ directory
# For httpd.conf, use this line instead of the next one:
RewriteRule
^(typo3|t3lib|tslib|fileadmin|typo3conf|typo3temp|uploads|showpic\.php|favicon\.ico)/
- [L]
# Redirect http://mysite/typo3 to http://mysite/typo3/index_re.php
# and stop the rewrite processing
# For httpd.conf, use this line instead of the next one:
RewriteRule ^typo3$ typo3/index_re.php [L]
My vhost config:
# VirtualHost F1
server {
listen 80;
server_name domain.pl;
root /var/www/domain.pl;
index index.php;
charset utf-8;
access_log /var/log/nginx/domain.pl.access.log;
error_log /var/log/nginx/domain.pl.error_log info;
rewrite rss.xml /index.php?id=221&type=100 last;
rewrite sitemap.xml /sitemap.xml;
rewrite ^typo3$ /typo3/index_re.php last;
rewrite
^(typo3|t3lib|tslib|fileadmin|typo3conf|typo3temp|uploads|showpic\.php|favicon\.ico)/
last;
location / {
if (!-e $request_filename) {
rewrite ^(.*) /index.php last;
}
}
location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|flv|swf|txt)$ {
access_log off;
expires 30d;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/domain.pl/$fastcgi_script_name;
include fastcgi_params;
}
}
More information about the nginx
mailing list