HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Server Operation (http://www.howtoforge.com/forums/forumdisplay.php?f=5)
-   -   Apche rewrite rule convert to nginx (http://www.howtoforge.com/forums/showthread.php?t=59683)

nerijussk 24th November 2012 10:33

Apche rewrite rule convert to nginx
 
Hello,
please help me converte apache rewrite rule to nginx:

RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^naujienos+ news.php/$1 [L]
RewriteRule ^naujienos/p(.*)$ /news.php?pg=$1 [nc]
RewriteRule ^naujienos/?$ /news.php [nc]
RewriteRule ^naujienos?$ /news.php [nc]

falko 25th November 2012 15:31

Have you tried these two .htaccess converters?

http://winginx.com/htaccess
http://www.anilcetin.com/convert-apa...cess-to-nginx/

nerijussk 25th November 2012 15:43

yes but does not work

falko 26th November 2012 19:15

Try

Code:

if (!-e $request_filename){
  rewrite ^/naujienos+ /news.php/$1 break;
}
rewrite ^/naujienos/p(.*)$ /news.php?pg=$1;
rewrite ^/naujienos/?$ /news.php;
rewrite ^/naujienos?$ /news.php;



All times are GMT +2. The time now is 09:21.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.