query-string

Replacing a querystring parameter value using mod_rewrite

时间秒杀一切 提交于 2020-01-20 05:09:07
问题 I would like to map this: http://www.example.com/index.php?param1=value1&param2=value2&param3=value3 (etc. ad infinitum) to http://www.example.com/index.php?param1=newvalue1&param2=value2&param3=value3 (etc.) In other words, just change the value of a single parameter in the query string. I know what the old value is, so I am trying to match the exact text index.php?param1=value1 and replace it with index.php?param1=newvalue1 . I cannot seem to find any examples on how to do this using mod

How to filter results by multiple query parameters if I don't know beforehand how many query strings I may receive from client side?

谁说我不能喝 提交于 2020-01-16 19:11:30
问题 I want to send in response some data according to searching by query parameters (using .find function of mongoose) from the client side. What do I need to do is a search according to the parameters received? What I mean is : I may receive localhost:5000/admin/customers?customer_id=1&customer_email=abc@gmail.com I could have used this code to send results according to this query : Customer.find({ customer_id = req.query.customer_id, customer_email = req.query.customer_email, }, (err,docs)=> {

.htaccess redirect query string value to another key

人走茶凉 提交于 2020-01-16 14:17:10
问题 What i'm trying to do is rewrite the following pattern http://example.org/path?articleid=5657 to this pattern: http://example.org/path?p=5657 Essentially it comes down to changing the key to the url parameter, i have searched extensively with no clear example of how to do this exact thing using only htaccess rewrite rules. i've tried this general approach with no luck RewriteCond %{QUERY_STRING} ^articleid=([0-9]*)$ RewriteRule ^articleid=([0-9]*)$ /?p=$1 [R=301,L] 回答1: You can't match

Search refinement for WebMatrix site

核能气质少年 提交于 2020-01-16 03:18:46
问题 I've been asking a few questions on this site, and have answers to lots of little bits, but I am now trying to piece the whole thing together. I have a page where it shows all the properties I have in my database. I need to find a way to refine those results though, so for example, to only show properties that have 4 bedrooms etc. The problem is, I don't know how many variables I might have in the search term yet. So here's an example. a user may want to see ALL properties that just have 4

htaccess rewrite QueryString disappears in Apache 2.2 but works in 2.4

柔情痞子 提交于 2020-01-16 00:29:26
问题 Following is the rule: RewriteRule ^api/([\w-]+)/?$ api.php?method=$1 [QSA] On local Apache 2.4 server, it allows me to rewrite like: /api/create-account/?name=abcd to /api.php?method=create-account&name=abcd On production server, which is Apache 2.2, the request goes to api.php . But I find not query string parameter in my script. If I dump $_REQUEST , $_GET or $_POST , I only get empty array. What am I missing? 回答1: You need to turn off Multiviews: Options -Multiviews Multiviews is a mod

Rewrite query string parameter into URL Apache

牧云@^-^@ 提交于 2020-01-15 18:52:00
问题 URL coming into Apache: localhost:8888/game?level=0 URL that should be coming out of apache: localhost:8888/level0/game Could someone kindly help me to create this rewrite ? Tried to solve it with following: RewriteEngine On RewriteRule ^game\/+(.*?)\?+level=+([0-9]+) /level$2/$1 [L,QSA] With no luck since it does not match. Thanks, Peter 回答1: To be able to capture values from the query string, you need a RewriteCond %{QUERY_STRING} directive, so that captured group will be available as %n

Rewrite query string parameter into URL Apache

僤鯓⒐⒋嵵緔 提交于 2020-01-15 18:50:50
问题 URL coming into Apache: localhost:8888/game?level=0 URL that should be coming out of apache: localhost:8888/level0/game Could someone kindly help me to create this rewrite ? Tried to solve it with following: RewriteEngine On RewriteRule ^game\/+(.*?)\?+level=+([0-9]+) /level$2/$1 [L,QSA] With no luck since it does not match. Thanks, Peter 回答1: To be able to capture values from the query string, you need a RewriteCond %{QUERY_STRING} directive, so that captured group will be available as %n

Rewrite query string parameter into URL Apache

时间秒杀一切 提交于 2020-01-15 18:50:35
问题 URL coming into Apache: localhost:8888/game?level=0 URL that should be coming out of apache: localhost:8888/level0/game Could someone kindly help me to create this rewrite ? Tried to solve it with following: RewriteEngine On RewriteRule ^game\/+(.*?)\?+level=+([0-9]+) /level$2/$1 [L,QSA] With no luck since it does not match. Thanks, Peter 回答1: To be able to capture values from the query string, you need a RewriteCond %{QUERY_STRING} directive, so that captured group will be available as %n

Query string breaking page

筅森魡賤 提交于 2020-01-15 10:31:25
问题 A Google Analytics query string on an incoming link breaks the display of my site. Does anyone know why the following would cause my site to fail to load its homepage properly (it appears to prevent the loading of some plugins that the page needs) http://mysite.com/?utm_medium=email While this does not: http://mysite.com/#utm_medium=email And if you know why, how do I fix this? I have incoming links that use the query string method and they are all resulting in the visitor seeing a broken

Django urls regex for query string

旧时模样 提交于 2020-01-15 07:15:27
问题 Following is from urls.py: url(r'^\?view=(?P<vtype>instructor|course|room)$', 'index', name='index'), i can verify that it works by simply calling django.core.urlresolvers.reverse in shell : In [6]: reverse('index', args=["course"]) Out[6]: '/?view=course' but when i try to access http://localhost:8000/?view=course i get 404. What am i doing wrong here? Thanks Edit: url('^search/\?user=(?P<userid>\d+)&type=topic', 'search_forum', name='my_topics'), this is from a former project which works as