Need help convert apache rewrite rules to nginx

Nerijus Skaržauskas nerijus.skarzauskas at gmail.com
Sun Nov 25 06:28:48 UTC 2012


Hello,
need help with convert apache rewrite rules to nginx. My .htaccess:


RewriteEngine on
RewriteBase /
ErrorDocument 404 /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^naujienos+ news.php/$1 [L]
RewriteRule     ^skelbimai/?$   index.php?p=20 [nc]
RewriteRule     ^skelbimai?$    index.php?p=20 [nc]
RewriteRule     ^reklama_svetaineje/?$  index.php?p=25 [nc]
RewriteRule     ^reklama_svetaineje?$   index.php?p=25 [nc]
RewriteRule     ^reklama_laikrastyje/?$ index.php?p=15 [nc]
RewriteRule     ^reklama_laikrastyje?$  index.php?p=15 [nc]
RewriteRule     ^prenumeratos_uzsakymas/?$      /prenumerata.php [nc]
RewriteRule     ^prenumeratos_uzsakymas?$       /prenumerata.php [nc]
RewriteRule     ^newprenum/?$   /pren_all.php [nc]
RewriteRule     ^newprenum?$    /pren_all.php [nc]
RewriteRule     ^negaunantiems_laiku/?$ index.php?p=24 [nc]
RewriteRule     ^negaunantiems_laiku?$  index.php?p=24 [nc]
RewriteRule     ^naujienos/p(.*)$       /news.php?pg=$1 [nc]
RewriteRule     ^naujienos/?$   /news.php [nc]
RewriteRule     ^naujienos?$    /news.php [nc]
RewriteRule     ^lics/?$        /Lics.php [nc]
RewriteRule     ^lics?$ /Lics.php [nc]
RewriteRule     ^kontaktai/?$   index.php?p=18 [nc]
RewriteRule     ^kontaktai?$    index.php?p=18 [nc]
RewriteRule     ^atsisiusk_dienrasti/?$ /newspaper.php [nc]
RewriteRule     ^atsisiusk_dienrasti?$  /newspaper.php [nc]
RewriteRule     ^apie_leidejus/?$       /leidejai.php [nc]
RewriteRule     ^apie_leidejus?$        /leidejai.php [nc]
RewriteRule     ^akcijos/?$     index.php?p=13 [nc]
RewriteRule     ^akcijos?$      index.php?p=13 [nc]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20121125/48a43793/attachment.html>


More information about the nginx mailing list