3 messages in ru.sysoev.nginxRewrite rules problems.
FromSent OnAttachments
Jérémy DierxJun 5, 2007 11:34 pm 
RoxisJun 6, 2007 12:10 am 
Jérémy DierxJun 6, 2007 1:09 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Rewrite rules problems.Actions...
From:Jérémy Dierx (jere@public.gmane.org)
Date:Jun 5, 2007 11:34:17 pm
List:ru.sysoev.nginx

Hello,

I have some problems with rewrite rules. First, excuse me for my bad English...

I have an htacces from Apache like :

RewriteEngine on DirectoryIndex gabarit.php?contenu=itineraire RewriteCond %{REQUEST_URI} !temporaire\.htm RewriteRule ^([a-z-]*)\.htm$ gabarit\.php?contenu=$1 [L] RewriteRule ^galeries/$ gabarit\.php?contenu=accueil-galerie [L] RewriteRule ^galeries/([0-9]*)/([0-9]*)\.htm$ gabarit \.php?contenu=detail-galerie&categorie=$1&galerie=$2 [L]

I want to translate it to Nginx rewrite rules

Here, a piece of my conf that doesn't work :

location / { index gabarit.php; root /home/work/jnbarak/current;

rewrite ^/(.*)\.htm$ /gabarit.php?contenu=$1 last; # it works ! rewrite ^/galeries/$ /gabarit\.php?contenu=accueil-galerie? last; # it doesn't work ! rewrite ^/galeries/([0-9]*)/([0-9]*)\.htm$ /gabarit \.php?contenu=detail-galerie&categorie=$1&galerie=$2 last; # it doesn't work ! }

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /home/work/jnbarak/current $fastcgi_script_name; include /usr/local/nginx/conf/fastcgi.conf; }

When I try :

http://my_domain.tld/galeries/

I have the error :

"No input file specified."

When I try :

http://my_domain.tld/galeries/1/5.htm

I am redirect to :

http://my_domain.tld/gabarit.php?contenu=accueil-galerie

Some one can help me please ?

Jérémy.