Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: Apache - RewriteRule removes url arguments |
|
Author |
|
phil1234
Joined: 24 Jul 2015 Posts: 11
|
Posted: Thu 16 Nov '17 11:40 Post subject: Apache - RewriteRule removes url arguments |
|
|
Hello,
I try to add a default parameter when using a particular domain name without any additional infos like ht tp:// www.mydomain.com[NOTHINGHERE]
apache keeps removing the parameter, doing some weird split and discarding it although I try many options SDI,QSA,L...
here is the quiet simple rule :
Code: |
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{QUERY_STRING} "^$"
RewriteRule ^(.*)$ ?s=somehashvalue [QSA,L]
|
here is the log :
Code: |
init rewrite engine with requested uri /
pass through /
[perdir /somedironmyserver/] strip per-dir prefix: /somedironmyserver/ ->
[perdir /somedironmyserver/] applying pattern '^(.*)$' to uri ''
[perdir /somedironmyserver/] RewriteCond: input='/somedironmyserver/' pattern='!-f' => matched
[perdir /somedironmyserver/] RewriteCond: input='' pattern='^$' => matched
[perdir /somedironmyserver/] rewrite '' -> '?s=somehashvalue'
split uri=?s=somehashvalue-> uri=, args=s=somehashvalue
[perdir /somedironmyserver/] add per-dir prefix: -> /somedironmyserver/
[perdir /somedironmyserver/] initial URL equal rewritten URL: /somedironmyserver/ [IGNORING REWRITE]
init rewrite engine with requested uri /index.html
pass through /index.html
[perdir /somedironmyserver/] strip per-dir prefix: /somedironmyserver/index.html -> index.html
[perdir /somedironmyserver/] applying pattern '^(.*)$' to uri 'index.html'
[perdir /somedironmyserver/] RewriteCond: input='/somedironmyserver/index.html' pattern='!-f' => not-matched
[perdir /somedironmyserver/] pass through /somedironmyserver/index.html
|
Thanks
Last edited by phil1234 on Fri 17 Nov '17 14:10; edited 1 time in total |
|
Back to top |
|
phil1234
Joined: 24 Jul 2015 Posts: 11
|
Posted: Fri 17 Nov '17 14:10 Post subject: |
|
|
come on any one ?
I really need an answer for this
thanks |
|
Back to top |
|
phil1234
Joined: 24 Jul 2015 Posts: 11
|
Posted: Fri 17 Nov '17 14:31 Post subject: |
|
|
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{QUERY_STRING} "^$"
RewriteBase /
RewriteRule ^(.*)$ ?s=hashvalue [QSA,L,R] |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Tue 21 Nov '17 17:19 Post subject: |
|
|
Did that work for you? |
|
Back to top |
|
|
|
|
|
|