Htaccess conversion nginx

hi nginx family,

RewriteEngine On
RewriteRule ^([0-9a-zA-Z]{1,6})$ links/?to=$1 [L]
RewriteRule ^([0-9]{1,9})/banner/(.)$ links/?uid=$1&adt=2&url=$2 [L]
RewriteRule ^([0-9]{1,9})/(.
)$ links/?uid=$1&adt=1&url=$2 [L]

help me.

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,222634,222634#msg-222634

Hello

On Sun, Feb 19, 2012 at 7:02 PM, rooxy [email protected] wrote:

hi nginx family,

RewriteEngine On
RewriteRule ^([0-9a-zA-Z]{1,6})$ links/?to=$1 [L]
RewriteRule ^([0-9]{1,9})/banner/(.)$ links/?uid=$1&adt=2&url=$2 [L]
RewriteRule ^([0-9]{1,9})/(.
)$ links/?uid=$1&adt=1&url=$2 [L]

help me.

Looks simple enough. Try this one:

rewrite ^/([0-9a-zA-Z]{1,6})$ /links/?to=$1 last;
rewrite ^/([0-9]{1,9})/banner/(.)$ /links/?uid=$1&adt=2&url=$2 last;
rewrite ^/([0-9]{1,9})/(.
)$ /links/?uid=$1&adt=1&url=$2 last;


O< ascii ribbon campaign - stop html mail - www.asciiribbon.org

Thank you for your help,

nginx: [emerg] directive “rewrite” is not terminated by “;” in
/usr/local/nginx/

this get the error.

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,222634,222637#msg-222637

On Sun, Feb 19, 2012 at 7:18 PM, rooxy [email protected] wrote:

Thank you for your help,

nginx: [emerg] directive “rewrite” is not terminated by “;” in
/usr/local/nginx/

this get the error.

I suggest using brain.


O< ascii ribbon campaign - stop html mail - www.asciiribbon.org

On Sun, Feb 19, 2012 at 7:29 PM, rooxy [email protected] wrote:

Thank you for the suggestion,

{1,6} here does not accept.

Yeah, I missed something.

The answer is here http://wiki.nginx.org/HttpRewriteModule


O< ascii ribbon campaign - stop html mail - www.asciiribbon.org

What should I do ?

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,222634,222685#msg-222685

On 19 February 2012 15:18, rooxy [email protected] wrote:

nginx: [emerg] directive “rewrite” is not terminated by “;” in
/usr/local/nginx/

Whenever ‘{’ and ‘}’ appear in a rewrite, the rewrite must be enclosed
in quotation marks.

So change the rewrites to …

rewrite ‘^/([0-9a-zA-Z]{1,6})$’ /links/?to=$1 last;
rewrite ‘^/([0-9]{1,9})/banner/(.)$’ /links/?uid=$1&adt=2&url=$2 last;
rewrite '^/([0-9]{1,9})/(.
)$’ /links/?uid=$1&adt=1&url=$2 last;

Nginx U. Wrote:

So change the rewrites to …
[email protected]
http://mailman.nginx.org/mailman/listinfo/nginx

did not :frowning:

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,222634,222688#msg-222688

On 20 February 2012 00:15, rooxy [email protected] wrote:

did not :frowning:
Did not what?

Did you reload Nginx?

What error message did you get if any?

You need to give information about your issue.

Thank you for the suggestion,

{1,6} here does not accept.

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,222634,222641#msg-222641

On 19 Fev 2012 20h43 WET, [email protected] wrote:

What should I do ?

Try:

location ~ “^/([0-9a-zA-Z]{1,6})$” {
return 302 /links/?to=$1;
}

location ~ “^/([0-9]{1,9})/banner/(.*)$” {
return 302 /links/?uid=$1&adt=2&url=$2;
}

location ~ “^/([0-9]{1,9})/(.*)$” {
return 302 /links/?uid=$1&adt=1&url=$2;
}

— appa

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs