Welcome! Log In Create A New Profile

Advanced

How to use ampersand (%26 not working)

Posted by lobo 
How to use ampersand (%26 not working)
July 31, 2010 07:07PM
I posted this on the php-fpm forum and they advised it will be more appropriate here. nginx is configured with php-fpm but PHP scripts are not being able to read the & correctly. Or even %26.

The PHP file has this statement: [b]echo $_GET['title'];[/b] and the URL is [b]index.php?title=D%26B[/b] then it only echoes [b]D[/b] (not [b]D&B[/b] as one would expect).

The debug log is at http://pastebin.com/ThgmBLGU

The config is
[code]
location ~ .php$ {
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_pass backend;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/pikadoo/public/goldeegarments$fastcgi_script_name;
include fastcgi_params;
## The line below was not commented earlier. But I tried to comment it out to resolve the & problem. No use :(
# fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_intercept_errors on;
fastcgi_ignore_client_abort off;
fastcgi_connect_timeout 60;
fastcgi_send_timeout 180;
fastcgi_read_timeout 180;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
}

upstream backend {
server 127.0.0.1:9000;
}


[/code]


I would appreciate any help to make & work. nginx version info:
[code]
nginx version: nginx/0.7.65
TLS SNI support enabled
configure arguments: --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx.pid --lock-path=/var/lock/nginx.lock --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/body --http-proxy-temp-path=/var/lib/nginx/proxy --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --with-debug --with-http_stub_status_module --with-http_flv_module --with-http_ssl_module --with-http_dav_module --with-http_gzip_static_module --with-http_realip_module --with-mail --with-mail_ssl_module --with-ipv6 --add-module=/build/buildd/nginx-0.7.65/modules/nginx-upstream-fair

[/code]
Re: How to use ampersand (%26 not working)
August 01, 2010 12:20AM
Never mind. This was a rewrite issue. The URL was not being rewritten correctly. It is now solved.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 265
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready