can somebody help me to rewrite this?

Francis Daly francis at daoine.org
Wed May 27 22:03:21 UTC 2015


On Sat, May 23, 2015 at 03:17:55PM -0400, escavern wrote:

Hi there,

> I need to rewrite from:
> www.mywebsite.com/showthread.php?t=123456
> 
> To
> 
> www.mywebsite.com/forum/showthread.php?t=123456

If the request is "/showthread.php", then redirect the client to the same
url but with "/forum" prepended -- it looks like that is what you want?

  location = /showthread.php { return 301 /forum$request_uri; }

Then configure your nginx-php interaction according to the application
documentation for it to be in a "subdirectory".
 
Cheers,

	f
-- 
Francis Daly        francis at daoine.org



More information about the nginx mailing list