You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Moritz Lennert <ml...@club.worldonline.be> on 2014/04/29 13:44:41 UTC

[users@httpd] rewrite and internal redirects

Hello,

I've been going crazy over this problem and even though I've seen
mentions of similar issues on this mailing list and elsewhere, I've just
not been able to apply the recipes there to solve my issue.

I have the following setup of a virtual host:

<VirtualHost *:80>
   ServerAdmin webmaster@localhost
   ServerName example.com

   DocumentRoot /home/geogf405/qgis-web-client/site
   <Directory />
     Options FollowSymLinks
     AllowOverride None
   </Directory>
   <Directory /home/geogf405/qgis-web-client/site/>
     Options Indexes FollowSymLinks MultiViews
     AllowOverride None
     Require all granted
     RewriteEngine On
     LogLevel trace3
     RewriteRule ^wms/(.+)$
/cgi-bin/qgis_mapserv.fcgi?map=/home/geogf405/PROJETS/$1.qgs [QSA,PT,L]
     RewriteRule ^balades/(.+)$
http://example.com/qgiswebclient.html?map=/home/geogf405/PROJETS/$1.qgs
#    RewriteRule ^balades/(.+)$
/qgiswebclient.html?map=/home/geogf405/PROJETS/$1.qgs
   </Directory>

   ScriptAlias /cgi-bin/ /home/geogf405/qgis-web-client/cgi-bin/
   <Directory "/home/geogf405/qgis-web-client/cgi-bin/">
     AllowOverride None
     Options +ExecCGI -MultiViews -SymLinksIfOwnerMatch
     Require all granted
     #Uncomment the next line to enable logging to a file
     #SetEnv QGIS_LOG_FILE /tmp/qgislog.txt
   </Directory>

So currently, when I enter example.com/balades/moritz it rewrites (or
actually redirects) to
http://example.com/qgiswebclient.html?map=/home/geogf405/PROJETS/moritz.qgs.

However, with that solution, it is the above URL which appears in the
browser. I would like to be able to enter example.com/balades/moritz and
keep seeing that URL but get the same result as
http://example.com/qgiswebclient.html?map=/home/geogf405/PROJETS/moritz.qgs.
This works perfectly with the first RewriteRule for wms.

So I tried with the (currently commented) second RewriteRule concerning
"balades":

RewriteRule ^balades/(.+)$ /qgiswebclient.html?map=/home/geogf405/PROJETS/$1.qgs

This just gives me a blank page in the Browser, no error message.

Looking at the logs, the rewrite seems to work, but apparently then an internal
redirect happens and everything is stripped from the URL:

[Tue Apr 29 11:30:56.452602 2014] [rewrite:trace3] [pid 14753:tid 140627917055744] mod_rewrite.c(475): [client XXX.XXX.XXX.XXX:34876] XXX.XXX.XXX.XXX - - [example.com/sid#7fe684a64b50][rid#7fe67c67a0a0/initial] [perdir /home/geogf405/qgis-web-client/site/] add path info postfix: /home/geogf405/qgis-web-client/site/balades -> /home/geogf405/qgis-web-client/site/balades/moritz.qgs
[Tue Apr 29 11:30:56.452615 2014] [rewrite:trace3] [pid 14753:tid 140627917055744] mod_rewrite.c(475): [client XXX.XXX.XXX.XXX:34876] XXX.XXX.XXX.XXX - - [example.com/sid#7fe684a64b50][rid#7fe67c67a0a0/initial] [perdir /home/geogf405/qgis-web-client/site/] strip per-dir prefix: /home/geogf405/qgis-web-client/site/balades/moritz.qgs -> balades/moritz.qgs
[Tue Apr 29 11:30:56.452623 2014] [rewrite:trace3] [pid 14753:tid 140627917055744] mod_rewrite.c(475): [client XXX.XXX.XXX.XXX:34876] XXX.XXX.XXX.XXX - - [example.com/sid#7fe684a64b50][rid#7fe67c67a0a0/initial] [perdir /home/geogf405/qgis-web-client/site/] applying pattern '^wms/(.+)$' to uri 'balades/moritz.qgs'
[Tue Apr 29 11:30:56.452636 2014] [rewrite:trace3] [pid 14753:tid 140627917055744] mod_rewrite.c(475): [client XXX.XXX.XXX.XXX:34876] XXX.XXX.XXX.XXX - - [example.com/sid#7fe684a64b50][rid#7fe67c67a0a0/initial] [perdir /home/geogf405/qgis-web-client/site/] add path info postfix: /home/geogf405/qgis-web-client/site/balades -> /home/geogf405/qgis-web-client/site/balades/moritz.qgs
[Tue Apr 29 11:30:56.452645 2014] [rewrite:trace3] [pid 14753:tid 140627917055744] mod_rewrite.c(475): [client XXX.XXX.XXX.XXX:34876] XXX.XXX.XXX.XXX - - [example.com/sid#7fe684a64b50][rid#7fe67c67a0a0/initial] [perdir /home/geogf405/qgis-web-client/site/] strip per-dir prefix: /home/geogf405/qgis-web-client/site/balades/moritz.qgs -> balades/moritz.qgs
[Tue Apr 29 11:30:56.452651 2014] [rewrite:trace3] [pid 14753:tid 140627917055744] mod_rewrite.c(475): [client XXX.XXX.XXX.XXX:34876] XXX.XXX.XXX.XXX - - [example.com/sid#7fe684a64b50][rid#7fe67c67a0a0/initial] [perdir /home/geogf405/qgis-web-client/site/] applying pattern '^balades/(.+)$' to uri 'balades/moritz.qgs'
[Tue Apr 29 11:30:56.452673 2014] [rewrite:trace2] [pid 14753:tid 140627917055744] mod_rewrite.c(475): [client XXX.XXX.XXX.XXX:34876] XXX.XXX.XXX.XXX - - [example.com/sid#7fe684a64b50][rid#7fe67c67a0a0/initial] [perdir /home/geogf405/qgis-web-client/site/] rewrite 'balades/moritz.qgs' -> '/qgiswebclient.html?map=/home/geogf405/PROJETS/moritz.qgs.qgs'
[Tue Apr 29 11:30:56.452683 2014] [rewrite:trace3] [pid 14753:tid 140627917055744] mod_rewrite.c(475): [client XXX.XXX.XXX.XXX:34876] XXX.XXX.XXX.XXX - - [example.com/sid#7fe684a64b50][rid#7fe67c67a0a0/initial] split uri=/qgiswebclient.html?map=/home/geogf405/PROJETS/moritz.qgs.qgs -> uri=/qgiswebclient.html, args=map=/home/geogf405/PROJETS/moritz.qgs.qgs
[Tue Apr 29 11:30:56.452715 2014] [rewrite:trace1] [pid 14753:tid 140627917055744] mod_rewrite.c(475): [client XXX.XXX.XXX.XXX:34876] XXX.XXX.XXX.XXX - - [example.com/sid#7fe684a64b50][rid#7fe67c67a0a0/initial] [perdir /home/geogf405/qgis-web-client/site/] internal redirect with /qgiswebclient.html [INTERNAL REDIRECT]
[Tue Apr 29 11:30:56.452771 2014] [rewrite:trace3] [pid 14753:tid 140627917055744] mod_rewrite.c(475): [client XXX.XXX.XXX.XXX:34876] XXX.XXX.XXX.XXX - - [example.com/sid#7fe684a64b50][rid#7fe67c675150/initial/redir#1] [perdir /home/geogf405/qgis-web-client/site/] strip per-dir prefix: /home/geogf405/qgis-web-client/site/qgiswebclient.html -> qgiswebclient.html
[Tue Apr 29 11:30:56.452780 2014] [rewrite:trace3] [pid 14753:tid 140627917055744] mod_rewrite.c(475): [client XXX.XXX.XXX.XXX:34876] XXX.XXX.XXX.XXX - - [example.com/sid#7fe684a64b50][rid#7fe67c675150/initial/redir#1] [perdir /home/geogf405/qgis-web-client/site/] applying pattern '^wms/(.+)$' to uri 'qgiswebclient.html'
[Tue Apr 29 11:30:56.452786 2014] [rewrite:trace3] [pid 14753:tid 140627917055744] mod_rewrite.c(475): [client XXX.XXX.XXX.XXX:34876] XXX.XXX.XXX.XXX - - [example.com/sid#7fe684a64b50][rid#7fe67c675150/initial/redir#1] [perdir /home/geogf405/qgis-web-client/site/] strip per-dir prefix: /home/geogf405/qgis-web-client/site/qgiswebclient.html -> qgiswebclient.html
[Tue Apr 29 11:30:56.452791 2014] [rewrite:trace3] [pid 14753:tid 140627917055744] mod_rewrite.c(475): [client XXX.XXX.XXX.XXX:34876] XXX.XXX.XXX.XXX - - [example.com/sid#7fe684a64b50][rid#7fe67c675150/initial/redir#1] [perdir /home/geogf405/qgis-web-client/site/] applying pattern '^balades/(.+)$' to uri 'qgiswebclient.html'
[Tue Apr 29 11:30:56.452795 2014] [rewrite:trace1] [pid 14753:tid 140627917055744] mod_rewrite.c(475): [client XXX.XXX.XXX.XXX:34876] XXX.XXX.XXX.XXX - - [example.com/sid#7fe684a64b50][rid#7fe67c675150/initial/redir#1] [perdir /home/geogf405/qgis-web-client/site/] pass through /home/geogf405/qgis-web-client/site/qgiswebclient.html


When I add [QSA,PT,L] at the end of the RewriteRule, I get the same result in the browser, but slightly different messages in the log:


[Tue Apr 29 11:39:01.466778 2014] [rewrite:trace3] [pid 14957:tid 140627917055744] mod_rewrite.c(475): [client XXX.XXX.XXX.XXX:34942] XXX.XXX.XXX.XXX - - [example.com/sid#7fe684a5eb50][rid#7fe67c67a0a0/initial] [perdir /home/geogf405/qgis-web-client/site/] add path info postfix: /home/geogf405/qgis-web-client/site/balades -> /home/geogf405/qgis-web-client/site/balades/moritz
[Tue Apr 29 11:39:01.466790 2014] [rewrite:trace3] [pid 14957:tid 140627917055744] mod_rewrite.c(475): [client XXX.XXX.XXX.XXX:34942] XXX.XXX.XXX.XXX - - [example.com/sid#7fe684a5eb50][rid#7fe67c67a0a0/initial] [perdir /home/geogf405/qgis-web-client/site/] strip per-dir prefix: /home/geogf405/qgis-web-client/site/balades/moritz -> balades/moritz
[Tue Apr 29 11:39:01.466798 2014] [rewrite:trace3] [pid 14957:tid 140627917055744] mod_rewrite.c(475): [client XXX.XXX.XXX.XXX:34942] XXX.XXX.XXX.XXX - - [example.com/sid#7fe684a5eb50][rid#7fe67c67a0a0/initial] [perdir /home/geogf405/qgis-web-client/site/] applying pattern '^wms/(.+)$' to uri 'balades/moritz'
[Tue Apr 29 11:39:01.466809 2014] [rewrite:trace3] [pid 14957:tid 140627917055744] mod_rewrite.c(475): [client XXX.XXX.XXX.XXX:34942] XXX.XXX.XXX.XXX - - [example.com/sid#7fe684a5eb50][rid#7fe67c67a0a0/initial] [perdir /home/geogf405/qgis-web-client/site/] add path info postfix: /home/geogf405/qgis-web-client/site/balades -> /home/geogf405/qgis-web-client/site/balades/moritz
[Tue Apr 29 11:39:01.466816 2014] [rewrite:trace3] [pid 14957:tid 140627917055744] mod_rewrite.c(475): [client XXX.XXX.XXX.XXX:34942] XXX.XXX.XXX.XXX - - [example.com/sid#7fe684a5eb50][rid#7fe67c67a0a0/initial] [perdir /home/geogf405/qgis-web-client/site/] strip per-dir prefix: /home/geogf405/qgis-web-client/site/balades/moritz -> balades/moritz
[Tue Apr 29 11:39:01.466824 2014] [rewrite:trace3] [pid 14957:tid 140627917055744] mod_rewrite.c(475): [client XXX.XXX.XXX.XXX:34942] XXX.XXX.XXX.XXX - - [example.com/sid#7fe684a5eb50][rid#7fe67c67a0a0/initial] [perdir /home/geogf405/qgis-web-client/site/] applying pattern '^balades/(.+)$' to uri 'balades/moritz'
[Tue Apr 29 11:39:01.466846 2014] [rewrite:trace2] [pid 14957:tid 140627917055744] mod_rewrite.c(475): [client XXX.XXX.XXX.XXX:34942] XXX.XXX.XXX.XXX - - [example.com/sid#7fe684a5eb50][rid#7fe67c67a0a0/initial] [perdir /home/geogf405/qgis-web-client/site/] rewrite 'balades/moritz' -> '/qgiswebclient.html?map=/home/geogf405/PROJETS/moritz.qgs'
[Tue Apr 29 11:39:01.466855 2014] [rewrite:trace3] [pid 14957:tid 140627917055744] mod_rewrite.c(475): [client XXX.XXX.XXX.XXX:34942] XXX.XXX.XXX.XXX - - [example.com/sid#7fe684a5eb50][rid#7fe67c67a0a0/initial] split uri=/qgiswebclient.html?map=/home/geogf405/PROJETS/moritz.qgs -> uri=/qgiswebclient.html, args=map=/home/geogf405/PROJETS/moritz.qgs
[Tue Apr 29 11:39:01.466863 2014] [rewrite:trace2] [pid 14957:tid 140627917055744] mod_rewrite.c(475): [client XXX.XXX.XXX.XXX:34942] XXX.XXX.XXX.XXX - - [example.com/sid#7fe684a5eb50][rid#7fe67c67a0a0/initial] [perdir /home/geogf405/qgis-web-client/site/] forcing '/qgiswebclient.html' to get passed through to next API URI-to-filename handler
[Tue Apr 29 11:39:01.466869 2014] [rewrite:trace1] [pid 14957:tid 140627917055744] mod_rewrite.c(475): [client XXX.XXX.XXX.XXX:34942] XXX.XXX.XXX.XXX - - [example.com/sid#7fe684a5eb50][rid#7fe67c67a0a0/initial] [perdir /home/geogf405/qgis-web-client/site/] internal redirect with /qgiswebclient.html [INTERNAL REDIRECT]
[Tue Apr 29 11:39:01.466929 2014] [rewrite:trace3] [pid 14957:tid 140627917055744] mod_rewrite.c(475): [client XXX.XXX.XXX.XXX:34942] XXX.XXX.XXX.XXX - - [example.com/sid#7fe684a5eb50][rid#7fe67c677368/initial/redir#1] [perdir /home/geogf405/qgis-web-client/site/] strip per-dir prefix: /home/geogf405/qgis-web-client/site/qgiswebclient.html -> qgiswebclient.html
[Tue Apr 29 11:39:01.466937 2014] [rewrite:trace3] [pid 14957:tid 140627917055744] mod_rewrite.c(475): [client XXX.XXX.XXX.XXX:34942] XXX.XXX.XXX.XXX - - [example.com/sid#7fe684a5eb50][rid#7fe67c677368/initial/redir#1] [perdir /home/geogf405/qgis-web-client/site/] applying pattern '^wms/(.+)$' to uri 'qgiswebclient.html'
[Tue Apr 29 11:39:01.466955 2014] [rewrite:trace3] [pid 14957:tid 140627917055744] mod_rewrite.c(475): [client XXX.XXX.XXX.XXX:34942] XXX.XXX.XXX.XXX - - [example.com/sid#7fe684a5eb50][rid#7fe67c677368/initial/redir#1] [perdir /home/geogf405/qgis-web-client/site/] strip per-dir prefix: /home/geogf405/qgis-web-client/site/qgiswebclient.html -> qgiswebclient.html
[Tue Apr 29 11:39:01.466964 2014] [rewrite:trace3] [pid 14957:tid 140627917055744] mod_rewrite.c(475): [client XXX.XXX.XXX.XXX:34942] XXX.XXX.XXX.XXX - - [example.com/sid#7fe684a5eb50][rid#7fe67c677368/initial/redir#1] [perdir /home/geogf405/qgis-web-client/site/] applying pattern '^balades/(.+)$' to uri 'qgiswebclient.html'
[Tue Apr 29 11:39:01.466971 2014] [rewrite:trace1] [pid 14957:tid 140627917055744] mod_rewrite.c(475): [client XXX.XXX.XXX.XXX:34942] XXX.XXX.XXX.XXX - - [example.com/sid#7fe684a5eb50][rid#7fe67c677368/initial/redir#1] [perdir /home/geogf405/qgis-web-client/site/] pass through /home/geogf405/qgis-web-client/site/qgiswebclient.html

I have trouble understanding the entire process of internal redirection and rewriting. I imagine that this is some simple configuration (RewriteBase ?) that needs to be added/changed, but I just can't wrap my head around it. Could someone give me pointers to where to look for the solution (and yes, I've read though the page on mod_rewrite, but this hasn't put me on the right path, yet) ?

Thank you !

Moritz


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] rewrite and internal redirects

Posted by Moritz Lennert <ml...@club.worldonline.be>.
On 29/04/14 14:02, Oscar Knorn wrote:
> Am 29.04.2014 13:44, schrieb Moritz Lennert:
>>
>> RewriteRule ^balades/(.+)$ /qgiswebclient.html?map=/home/geogf405/PROJETS/$1.qgs
>
> Please insert these Rewriterules Directly after the DocumentRoot Directive and before the <Directory>-Section :
>
> RewriteRule ^/balades/moritz(.+)$ /home/geogf405/qgis-web-client/site [R,L]
> RewriteRule ^/wms(.+)$ /home/geogf405/qgis-web-client/site [QSA,PT,L]
>
> Please post the log Files

I get a 404:

The requested URL /balades/moritz was not found on this server.

Logs attached.

Moritz



Re: [users@httpd] rewrite and internal redirects

Posted by Oscar Knorn <os...@uni-duisburg-essen.de>.
Am 29.04.2014 13:44, schrieb Moritz Lennert:
>
> RewriteRule ^balades/(.+)$
> /qgiswebclient.html?map=/home/geogf405/PROJETS/$1.qgs 

Please insert these Rewriterules Directly after the DocumentRoot
Directive and before the <Directory>-Section :

RewriteRule ^/balades/moritz(.+)$ /home/geogf405/qgis-web-client/site [R,L]
RewriteRule ^/wms(.+)$  /home/geogf405/qgis-web-client/site [QSA,PT,L]

Please post the log Files

Re: [users@httpd] rewrite and internal redirects

Posted by Moritz Lennert <ml...@club.worldonline.be>.
I still haven't found the solution, so any additional help would be 
appreciated:

On 30/04/14 13:54, Moritz Lennert wrote:
> On 29/04/14 13:54, Eric Covener wrote:
>> On Tue, Apr 29, 2014 at 7:44 AM, Moritz Lennert
>> <ml...@club.worldonline.be> wrote:
>>> I have trouble understanding the entire process of internal redirection and
>>> rewriting. I imagine that this is some simple configuration (RewriteBase ?)
>>> that needs to be added/changed, but I just can't wrap my head around it.
>>> Could someone give me pointers to where to look for the solution (and yes,
>>> I've read though the page on mod_rewrite, but this hasn't put me on the
>>> right path, yet) ?
>>
>> Generally you shouldn't put your rewrites in <directory>. It delays
>> their execution and makes them more complicated (every rewrite results
>> in an internal redirect).
>>
>> If you are in <directory> or use [PT], you usually want to rewrite
>> from URL to URL not URL to filesystem path.
>>
>> These might simplify things so much that you can sort out whatever is wrong.
>>
>> When you move from <directory> context, you'll have to change your
>> rules a little bit because you'll be matching against the entire URL,
>> beginning with /.
>
>
> Thanks to Eric and Oscar for the tips.
>
> I've moved the RewriteRules outside <directory>, both before and after (I didn't see any difference).
> I still have the same issue. But I've come a bit further:
>
> Actually, the rewrite rule concerning balades:
>
> RewriteRule ^balades/(.+)$ /qgiswebclient.html?map=/home/geogf405/PROJETS/$1.qgs [PT,L]
>
> Does result in a the returning of qgiswebclient.html.
>
> In that page, however there are a lot of references to css and javascript files such as:
>
> libs/ext/resources/css/ext-all-notheme.css
> js/GlobalOptions.js
>
> Looking in the logs, I see things like
>
> init rewrite engine with requested uri /balades/libs/ext/resources/css/ext-all-notheme.css, referer: http://example.com/balades/moritz
> and then
> rewrite '/balades/libs/ext/resources/css/ext-all-notheme.css' -> '/qgiswebclient.html?map=/home/geogf405/PROJETS/libs/ext/resources/css/ext-all-notheme.css.qgs', referer: http://example.com/balades/moritz
>
> I've resolved this by making all these links absolute by adding a slash at the beginning:
>
> /libs/ext/resources/css/ext-all-notheme.css
> /js/GlobalOptions.js
> etc
>
> Now I get a step further and can actually see qgiswebclient.html beginning to load in the browser, but then I get an error message (from the page) telling me that some startup parameters are missing. This is apparently because only qgiswebclient.html is called, but without the map=/home/geogf405/PROJETS/$1.qgs part.
>
> In the logs (complete logs attached) I see:
>
> rewrite '/balades/moritz' -> '/qgiswebclient.html?map=/home/geogf405/PROJETS/moritz.qgs'
> split uri=/qgiswebclient.html?map=/home/geogf405/PROJETS/moritz.qgs -> uri=/qgiswebclient.html, args=map=/home/geogf405/PROJETS/moritz.qgs
>
> and then
>
> (
> forcing '/qgiswebclient.html' to get passed through to next API URI-to-filename handler
> )
> OR
> (
> local path result: /qgiswebclient.html
> prefixed with document_root to /home/geogf405/qgis-web-client/site/qgiswebclient.html
> )
>
> depending on whether I set [PT] or not.
>
> But in both cases the args part seems to get lost.
>
> I have the feeling I'm getting very close, but can't see the next step.
>
> Moritz
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] rewrite and internal redirects

Posted by Moritz Lennert <ml...@club.worldonline.be>.
On 29/04/14 13:54, Eric Covener wrote:
> On Tue, Apr 29, 2014 at 7:44 AM, Moritz Lennert
> <ml...@club.worldonline.be> wrote:
>> I have trouble understanding the entire process of internal redirection and
>> rewriting. I imagine that this is some simple configuration (RewriteBase ?)
>> that needs to be added/changed, but I just can't wrap my head around it.
>> Could someone give me pointers to where to look for the solution (and yes,
>> I've read though the page on mod_rewrite, but this hasn't put me on the
>> right path, yet) ?
>
> Generally you shouldn't put your rewrites in <directory>. It delays
> their execution and makes them more complicated (every rewrite results
> in an internal redirect).
>
> If you are in <directory> or use [PT], you usually want to rewrite
> from URL to URL not URL to filesystem path.
>
> These might simplify things so much that you can sort out whatever is wrong.
>
> When you move from <directory> context, you'll have to change your
> rules a little bit because you'll be matching against the entire URL,
> beginning with /.


Thanks to Eric and Oscar for the tips.

I've moved the RewriteRules outside <directory>, both before and after (I didn't see any difference).
I still have the same issue. But I've come a bit further:

Actually, the rewrite rule concerning balades:

RewriteRule ^balades/(.+)$ /qgiswebclient.html?map=/home/geogf405/PROJETS/$1.qgs [PT,L]

Does result in a the returning of qgiswebclient.html.

In that page, however there are a lot of references to css and javascript files such as:

libs/ext/resources/css/ext-all-notheme.css
js/GlobalOptions.js

Looking in the logs, I see things like

init rewrite engine with requested uri /balades/libs/ext/resources/css/ext-all-notheme.css, referer: http://example.com/balades/moritz
and then
rewrite '/balades/libs/ext/resources/css/ext-all-notheme.css' -> '/qgiswebclient.html?map=/home/geogf405/PROJETS/libs/ext/resources/css/ext-all-notheme.css.qgs', referer: http://example.com/balades/moritz

I've resolved this by making all these links absolute by adding a slash at the beginning:

/libs/ext/resources/css/ext-all-notheme.css
/js/GlobalOptions.js
etc

Now I get a step further and can actually see qgiswebclient.html beginning to load in the browser, but then I get an error message (from the page) telling me that some startup parameters are missing. This is apparently because only qgiswebclient.html is called, but without the map=/home/geogf405/PROJETS/$1.qgs part.

In the logs (complete logs attached) I see:

rewrite '/balades/moritz' -> '/qgiswebclient.html?map=/home/geogf405/PROJETS/moritz.qgs'
split uri=/qgiswebclient.html?map=/home/geogf405/PROJETS/moritz.qgs -> uri=/qgiswebclient.html, args=map=/home/geogf405/PROJETS/moritz.qgs

and then

(
forcing '/qgiswebclient.html' to get passed through to next API URI-to-filename handler
)
OR
(
local path result: /qgiswebclient.html
prefixed with document_root to /home/geogf405/qgis-web-client/site/qgiswebclient.html
)

depending on whether I set [PT] or not.

But in both cases the args part seems to get lost.

I have the feeling I'm getting very close, but can't see the next step.

Moritz

Re: [users@httpd] rewrite and internal redirects

Posted by Eric Covener <co...@gmail.com>.
On Tue, Apr 29, 2014 at 7:44 AM, Moritz Lennert
<ml...@club.worldonline.be> wrote:
> I have trouble understanding the entire process of internal redirection and
> rewriting. I imagine that this is some simple configuration (RewriteBase ?)
> that needs to be added/changed, but I just can't wrap my head around it.
> Could someone give me pointers to where to look for the solution (and yes,
> I've read though the page on mod_rewrite, but this hasn't put me on the
> right path, yet) ?

Generally you shouldn't put your rewrites in <directory>. It delays
their execution and makes them more complicated (every rewrite results
in an internal redirect).

If you are in <directory> or use [PT], you usually want to rewrite
from URL to URL not URL to filesystem path.

These might simplify things so much that you can sort out whatever is wrong.

When you move from <directory> context, you'll have to change your
rules a little bit because you'll be matching against the entire URL,
beginning with /.


-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org