Rewrite with apostrophe causes 404



above causes 404

if i manually edit the url to videos/1432/so-it’s-ok-karyn-garcia it

Here is the rewrite rule

rewrite ^/videos/([^/])/([^/])$ /play.php?vid=$1 last;

Can you tell me how can i fix this ?


Posted at Nginx Forum:,89455,89455#msg-89455

on opera and firefox the urls are automatically corrected and workin
with the rewrite rules like follows


but on internet explorer its not being corrected.

Posted at Nginx Forum:,89455,89476#msg-89476

I solved this myself, forgot to put the solution here, the following
removes /’ and replaces it with nothing so urls work in all browsers.

if ($uri ~ “^(.)/’(.)$”){
set $rule_0 1$rule_0;
set $bref_1 $1;
set $bref_2 $2;
if ($rule_0 = “1”){
rewrite /. /$bref_1$bref_2 permanent;

Maybe this will help someone too.

Posted at Nginx Forum:,89455,122369#msg-122369

On Sun, May 23, 2010 at 04:47:49PM -0400, st1905 wrote:

rewrite ^/videos/([^/])/([^/])$ /play.php?vid=$1 last;

Can you tell me how can i fix this ?

location = /videos/1432/so-it/'s-ok-karyn-garcia {
fastcgi_pass …
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /path/to/play.php;
fastcgi_param QUERY_STRING vid=1432/so-it/'s-ok-karyn-garcia;

Igor S.

Thanks a lot Igor. It works just like the way it should be but there are
thousands of videos and i dont know how many of them have this issue.

Posted at Nginx Forum:,89455,123143#msg-123143