[英]Convert rewrite rules to nginx conf for typo3
我有以下重写规则。 他们需要让CoolURI for typo3在Apache服务器上运行。 现在我想为nginx服务器做同样的事情。
RewriteEngine On
RewriteRule ^/(typo3|typo3temp|typo3conf|t3lib|tslib|fileadmin|uploads|showpic\.php)$ - [L]
RewriteRule ^/(typo3|typo3temp|typo3conf|t3lib|tslib|fileadmin|uploads|showpic\.php)/.*$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule .* index.php
任何人都可以帮助我将这些转换为nginx conf吗? 我发现这个http://nginx.org/en/docs/http/converting_rewrite_rules.html但是我对nginx很新,并且无法弄清楚如何转换这个......
有任何想法吗?
这应该工作:
location / {
index index.php index.html index.htm;
try_files $uri @rewrite;
}
location @rewrite {
rewrite ^/(typo3|typo3temp|typo3conf|t3lib|tslib|fileadmin|uploads|showpic\.php)$ - last;
rewrite ^/(typo3|typo3temp|typo3conf|t3lib|tslib|fileadmin|uploads|showpic\.php)/.*$ - last;
}
你可以把它放在server { ... }
声明中。
我不使用Typo3,所以我不能肯定它是否会起作用,但它可能只需要一些基本的调整。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.