2014-08-29 82 views
0

我需要將這個htaccess文件轉換爲用於nginx的try_files,但我無法爲我的生活做到這一點。有人可以幫忙嗎?Nginx,.Htaccess和try_files

Options +FollowSymlinks 
Options -MultiViews 
RewriteEngine On 
RewriteBase/
RewriteRule ^img-(.*)\.html img.php?id=$1 [L] 
RewriteRule ^slide-(.*)\.html slider.php?id=$1 [L] 
RewriteRule ^page-(.*)\.html page.php?name=$1 [L] 
RewriteRule ^contact\.html$ contact.php [QSA,L,NC] 
+1

你想在try_files做什麼?這裏簡單的重寫應該可以工作。 – 2014-08-29 04:12:46

回答

0

你不需要在這裏try_files:

rewrite ^/img-(.*).html$ /img.php?id=$1 last; 
rewrite ^/slide-(.*).html$ /slider.php?id=$1 last; 
rewrite ^/page-(.*).html$ /page.php?name=$1 last; 
rewrite ^/contact.html$ /contact.php last; 
+0

謝謝阿列克謝。你救了我的命。 – 2014-09-02 14:16:19