Steve,
Thanks for the suggestion. How would this additional check change the
solution I proposed on 9/16? It looks like it would prevent the rewrite
from occurring if other arguments (instead of title) were present?
Thanks again,
Andrew
On Sun, Sep 8, 2013 at 11:31 PM, Steve Holdoway
Francis,
I ended up coming up with this solution:
map $request_uri $request_basename {
~/(?captured_request_basename[^/?]*)(?:\?|$)
$captured_request_basename;
}
server [
try_files $uri $uri/ @rewrite;
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info
Francis,
Using the similar statement try_files $uri $uri/ /index.php;, if I visit
this URL:
http://mysite.com/index.php?title=my_test_page
then the URL is rewritten to this, but it just loads the contents of
index.php (without the title variable):
http://mysite.com/my_test_page
What it shows
On Wed, Sep 11, 2013 at 08:32:09AM -0500, Andrew Martin wrote:
Hi there,
Using the similar statement try_files $uri $uri/ /index.php;, if I visit
this URL:
http://mysite.com/index.php?title=my_test_page
then the URL is rewritten to this, but it just loads the contents of
index.php (without
On Mon, Sep 09, 2013 at 08:23:36AM -0500, Andrew Martin wrote:
Hi there,
If I use this line:
rewrite ^/index\.php(.*)$ http://mysite.com/$arg_title? redirect;
/index.php?title=my_test_page redirects to /my_test_page
That's what you asked for initially; I'd probably spell it as
location
rewrite ^/index\.php?title=(.*)$ http://www.mysite.com/$1 redirect;
this doesnt work? what is $1 then in the redirected request?
Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,242676,242678#msg-242678
___
nginx mailing list
nginx@nginx.org
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 mysite.com;
try_files $uri $uri/ index.php;
location / {
rewrite ^/index\.php?title=(.*)$
http://mysite.com/$arg_title
--- Original message ---
From: Andrew Martin andrew.s.mar...@gmail.com
Date: 9 September 2013, 15:53:01
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 mysite.com;
try_files $uri $uri/
If I use this line:
rewrite ^/index\.php(.*)$ http://mysite.com/$arg_title? redirect;
/index.php?title=my_test_page redirects to /my_test_page
This is the URL I am looking for, but it still results in a 404, with this
displayed in the log:
[error] 16077#0: *156649 FastCGI sent in stderr: Primary
Hello,
I have read through the nginx rewrite documentation and looked at various
examples, but can't figure out how to create a rewrite rule for the
following (if it is possible). I'd like to rewrite the URL of a php file
with a $_GET argument and replace it with just the value of the $_GET
10 matches
Mail list logo