<div dir="ltr">If I use this line:<br>rewrite ^/index\.php(.*)$ <a href="http://mysite.com/$arg_title">http://mysite.com/$arg_title</a>? redirect;<br><div><br></div><div>/index.php?title=my_test_page redirects to /my_test_page</div>
<div><br></div><div>This is the URL I am looking for, but it still results in a 404, with this displayed in the log:</div><div>[error] 16077#0: *156649 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client xxx.xxx.xxx.xxx, server: <a href="http://mysite.com">mysite.com</a>, request: "GET /my_test_page HTTP/1.1", upstream: "fastcgi://<a href="http://127.0.0.1:9000">127.0.0.1:9000</a>", host: "<a href="http://mysite.com">mysite.com</a>"<br>
</div><div><br></div><div>Thanks,</div><div><br></div><div>Andrew</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Sep 9, 2013 at 8:05 AM, wishmaster <span dir="ltr"><<a href="mailto:artemrts@ukr.net" target="_blank">artemrts@ukr.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br>
<br>
--- Original message ---<br>
From: "Andrew Martin" <<a href="mailto:andrew.s.martin@gmail.com">andrew.s.martin@gmail.com</a>><br>
Date: 9 September 2013, 15:53:01<br>
<br>
<br>
> Thanks for the suggestions. I was not able to get $arg_title to work. Here is the relevant section of my nginx config: server_name <a href="http://mysite.com" target="_blank">mysite.com</a>;<br>
><br>
><br>
><br>
><br>
> try_files $uri $uri/ index.php;<br>
><br>
><br>
> location / {<br>
> rewrite ^/index\.php?title=(.*)$ <a href="http://mysite.com/$arg_title" target="_blank">http://mysite.com/$arg_title</a> redirect;<br>
><br>
</div> May be something like this :<br>
rewrite ^/index\.php.* <a href="http://mysite.com/$arg_title" target="_blank">http://mysite.com/$arg_title</a> redirect;<br>
I think nginx "know" about all arguments in your request, therefore simple specify needed argument's name in the second part of rewrite rule.<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a></div></div></blockquote></div><br></div>