Hello Robert,
Wednesday, November 18, 2009, 9:17:23 PM, you wrote:
> Can anyone tell me how to rewrite this rules from apache:
> RewriteEngine On
> RewriteRule ^shorten/(.*)$ shorten.php?longurl=$1 [L]
> RewriteRule ^([0-9a-zA-Z]{1,6})$ redirect.php?url=$1 [L]
> to nginx?
> Thanks!
location ~ ^/shorten/(?<longurl>.*)$ {
root ...;
fastcgi_pass ...;
fastcgi_param SCRIPT_NAME /shorten.php;
fastcgi_param SCRIPT_FILENAME $document_root/shorten.php;
fastcgi_param QUERY_STRING longurl=$longurl;
}
location ~ "^/(?<url>[0-9a-zA-Z]{1,6})$" {
root ...;
fastcgi_pass ...;
fastcgi_param SCRIPT_NAME /redirect.php;
fastcgi_param SCRIPT_FILENAME $document_root/redirect.php;
fastcgi_param QUERY_STRING url=$url;
}
--
Best regards,
Denis mailto:denis@gostats.ru