Questions tagged [querystring]

A query string is a part of the URL (uniform resource locator). It consists of pairs of attributes and values. For instance, the URL https://ahost:8443/test?id=21 has a query string with the attribute "id" whose value is "21"

A query string is a part of the URL (uniform resource locator). It consists of pairs of attribute-value. For instance, the URL https://ahost:8443/test?id=21 has a query string with the attribute "id" whose value is "21"

69 questions
14
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
  • 275
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…
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
  • 997
10
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
  • 201
  • 1
  • 2
  • 6
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…
7
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…
6
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
  • 161
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…
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,803
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…
3
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
  • 131
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
3
votes
1 answer

Appending the query params the right way when using proxy_pass with nginx

I have my nginx proxy pass config setup as follows: location /try-me { proxy_pass https://some-domain.com?id=true&zone=false } This works fine. But the problem is when someone from the browser…
Amanda
  • 145
2
votes
1 answer

nginx rewrite if query string exists

In the past a project was getting moved from / to /subdir. As the old URL structure was something like /index.php?foo/123/bar I used the following rewrite to get everything to /forum: rewrite ^\/index\.php(.*)$ /forum/$1 last; The problem with this…
KittMedia
  • 258
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…
1
2 3 4 5