Rewrite

tseveendorj tseveendorj at on-air.mn
Thu Apr 7 01:41:46 UTC 2016


    
Thank you Francis. It is working now.


Sent from my Samsung device

-------- Original message --------
From: Francis Daly <francis at daoine.org> 
Date: 06/04/2016  07:48  (GMT+08:00) 
To: nginx at nginx.org 
Subject: Re: Rewrite 

On Tue, Apr 05, 2016 at 08:11:44PM +0900, tseveendorj wrote:

Hi there,

> request URL is http://domain.com/x4Zbs5B
> It should be http://domain.com/index.php?download=x4Zbs5B
> 
> I tried
> location / {
>                 rewrite ^/([^/][a-zA-Z0-9]+)$ /index.php?download=$1 break;

I'm not sure that the four characters "[^/]" are doing anything useful
on that line.

I am sure that "break" is not what you want there. Just remove it.

>                 try_files $uri $uri/ /index.php?download=$uri;
>         }
> but it is downloading index.php file itself :D

Presumably somewhere else in your config you tell nginx how to handle
/index.php?

	f
-- 
Francis Daly        francis at daoine.org

_______________________________________________
nginx mailing list
nginx at nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20160407/06565073/attachment.html>


More information about the nginx mailing list