[英]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.