Questions tagged [querystring]

65 questions
13
votes
2 answers

Nginx Rewrite Convert Querystring to Path

I whould like this simple rewrite rule: /somefolder/mypage.aspx?myid=4343&tab=overview to be redirected to: /folder/4343/overview/ I looked for some solutions and none actually worked.. I tried: rewrite…
YardenST
  • 255
  • 2
  • 3
  • 7
13
votes
1 answer

Apache mod_rewrite double encodes query string on redirect

We've encountered a strange issue (a bug, perhaps?) with Apache mod_rewrite's behavior when passing through query strings. To reproduce, we've set up a clean Ubuntu (oneiric) install with the default Apache configuration. We have enabled…
Erik Hesselink
  • 231
  • 2
  • 7
13
votes
4 answers

Rewritten URLs with parameter length > 255 don't work

I'm using mod_rewrite to rewrite URLs like this: http://example.com/1,2,3,4/foo/ By doing this in .htaccess: RewriteEngine On RewriteRule ^([\d,]+)/foo/$ /foo.php?id=$1 [L,QSA] It works fine, except for when "1,2,3,4" turns into a string longer…
philfreo
  • 987
  • 2
  • 9
  • 22
9
votes
1 answer

IIS URL Rewrite Module Query String Parameters

Is it possible to use URL Rewrite to provide more complex query string functionality than the "Append query string" checkbox that it has? Specifically, is it possible to specify the keys for certain query string parameters and have it only append…
Jason Kresowaty
  • 501
  • 2
  • 6
  • 20
7
votes
1 answer

Nginx ignore query string for caching certain files

I know my setup is a bit crazy, but whatever.... I set up Nginx on Openshift to cache map tiles (for a map viewer, you can guess the purpose, :-) ) that are served from my home network, which has limited bandwidth (stupid wireless connections!).…
Andrew Sun
  • 171
  • 1
  • 1
  • 5
6
votes
2 answers

RedirectMatch and Query String

Compare these two RedirectMatch's. The first doesn't work: RedirectMatch 302 ^/redirect\.php[?]page=(.+)$ http://somewhereelse.com/$1 Versus this, which will redirect to http://somewhereelse.com/?page=wherever: RedirectMatch 302…
nate
  • 207
  • 1
  • 3
  • 9
6
votes
2 answers

How do you redirect URLs with a query string to another host?

This htaccess snippet is supposed to redirect myhost.com/?p=1&preview=true to alt.myhost.com/?p=1&preview=true RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^myhost.com$ [NC] RewriteRule ^/\?p=([0-9]+)&preview=true$…
qodeninja
  • 2,723
  • 10
  • 31
  • 33
5
votes
2 answers

Nginx & PHP-FPM: Query parameters won't be passed to PHP

I am currently setting up a machine for local development using Vagrant. Everything runs as it should, expect query parameters aren't passed to PHP on subpages. That means on www.example.com/?a=b, the query parameter is accessible, but on…
Sven
  • 151
  • 1
  • 1
  • 3
5
votes
1 answer

NGINX proxy caching - cache buster variable in querystring - possible to ignore?

We have the following url we would like to proxy cache: file.php?parameter=one¶mater2=two&r=EPOCHTIMESTAMP Query string parameter "parameter" varies between requests. So does "paramater2". Query stringing parameter r is a timestamp we use to…
anonymous-one
  • 958
  • 4
  • 26
  • 43
5
votes
5 answers

Parse HTTP requests through Wireshark?

Is there any way to parse HTTP request data in wireshark? For example, can I expose the request parameters upon an HTTP GET request (being sent by my machine), so that I don't need to read the (sometimes) truncated URL and find them by myself? I was…
diogobaeder
  • 151
  • 1
  • 3
3
votes
1 answer

Use apache to block a url with specific query string

I have this url: mysite.com?var=var&var2=var2&var3=var3 I would like to block this specific url but not in any way affect other query strings on the same base url. Is it possible to do this? Thanks,
rix
  • 35
  • 1
  • 1
  • 4
2
votes
1 answer

How to redirect with query string in Nginx

I would like to redirect: something.com/search?keywords='value' to something.com/search?q='value' Here is my Nginx config: location ~ /search { if ($args ~* "keywords=(.*)") { rewrite ^.*$ /search?q=$arg_keywords permanent; …
Ordidaad
  • 121
  • 1
  • 2
2
votes
0 answers

Rewrite rule loses query parameters

I have a webserver running apache2 with php7. In my apache config, there is a redirect rule like the following: RewriteCond %{HTTP_HOST} !^www.* RewriteRule .* %{HTTP:X-Forwarded-Proto}://www.%{HTTP_HOST}%{REQUEST_URI} [QSA,R=301,L] This should…
2
votes
1 answer

Lighttpd QUERY_STRING escape properly

Problem is to escape query string in Lighttpd: This is url: domain/publisher/adframe-34.html?tag=xzzx&gg=yy&uu=121 and this is lighty rule: adframe-([1-9][0-9]*)\.html\?(.*)" => "ad/frame.php?ad_unit_id=$1&addl=$2 What I am expecting is that addl…
2
votes
1 answer

nginx rule to capture header and append value as query string

I have an interesting problem I need to solve in nginx: one of the sites I'm building receives inbound traffic on port 80 (and only port 80) which may have a certain header set in the request. If this header is present I need to capture the value of…
John Schulze
  • 73
  • 1
  • 6
1
2 3 4 5