C
C
cat_crash2012-04-24 11:22:01
Nginx
cat_crash, 2012-04-24 11:22:01

How to translate Apache rewrite --> nginx?

Good afternoon, friends

It so happened that the admin is "on vacation" and I was strongly asked to move the project from apache to nginx. It seems to have coped with everything except 1 part related to rewrite rules.
So in the Apache config, it looks like this: The RewriteRule itself is not very scary, the docks are in hand and went ... But the line RewriteCond %{ENV:REDIRECT_STATUS} ^$ causes me certain problems. Khabrovites, do not let the abyss :) Thank you in advance
<IfModule mod_rewrite.c>
RewriteEngine On

#Article images rules
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule ^minsk_anons/[a-z0-9\_\-]+\.(jpg|gif|png)$ /834a74fe95a05a05a95d7cfaec9cc494.php [L]

#Articles rules
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule ^minsk_anons/[0-9]{2,4}[0-9]{1,2}[0-9]{1,2}_([0-9]+)\.html$ /834a74fe95a05a05a95d7cfaec9cc494.php [L]







Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
MARDEN, 2012-04-24
@MARDEN

The most normal converter is winginx.ru/htaccess

D
DurRandir, 2012-04-24
@DurRandir

Just ignore them. They are there in order not to run these rules again (due to the logic of how mod_rewrite works). In nginx, you don’t need to do rewrites at all, but write it right away with locations.

A
Alexander, 2012-04-24
@baltazorbest

Occasionally I use www.anilcetin.com/convert-apache-htaccess-to-nginx/ this converter, try it, maybe it will help you

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question