Welcome! Log In Create A New Profile

Advanced

Problems with rewrites

Posted by jlouzao 
Problems with rewrites
January 12, 2010 03:01AM
Hi all.

I'm trying to convert this .htaccess to nginx rewrites:

RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule !\.(js|ico|txt|gif|jpg|png|css)$ index.php
RewriteRule ^screenshots/([0-9]+)([0-9]{2})_([0-9]+).png$ http://images.mydomain.com/screenshots/$2/$1_$3.png [L]
RewriteRule ^resources/img/screenshots/([0-9]+)([0-9]{2})_([0-9]+).png$ http://images.mydomain.com/screenshots/$2/$1$2_$3.png [L]
RewriteRule ^screenshots/([0-9]+)/([0-9_]+).(png|jpg)$ http://images.mydomain.com/screenshots/$1/$2.png [L]

This one looks to work fine:
rewrite /!\.(js|ico|txt|gif|jpg|png|css)$ /index.php;

But this other makes a config error:
rewrite ^/screenshots/([0-9]+)([0-9]{2})_([0-9]+).png$ http://images.mydomain.com/screenshots/$2/$1_$3.png last;

Could some help?

Regards.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 126
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready