Note that there are some explanatory texts on larger screens.

plurals
  1. POApache rewrite certain urls to separate part of codebase
    primarykey
    data
    text
    <p>Basically I have 2 separate code bases, v1 and v2 for the sake of this example. I want to redirect a certain area of the v1 site to v2 so we can periodically port the old code to new code.</p> <p>Now, I have done this exact sort of code porting before, I just can't remember the exact specifics and whether we did some apache voodoo to get it to work. This time round I can get it to hit the v2 code but then subsequent requests use the v1 vhost and so the images v2 are requesting are translating to v1's path and do not exist.</p> <p>So I want domain1.com/foo/bar to get redirected to the v2 codebase, in the v1 vhost (under /home/domain1) I have:</p> <pre><code>RewriteRule ^/foo/?([0-9a-zA-Z]*)/?(([0-9a-zA-Z/]*))$ /home/domain2/index.php?controller=foo&amp;action=$1&amp;params=$2 [NC,L] </code></pre> <p>This successfully catches the request and passes it to the v2 codebase, but then the v2 codebase continues to use the v1 vhost. Obviously I would like it to hit the v2 codebase and start to use that vhost, but without using an external redirect [R]</p> <p>The output from the rewrite log is as follows:</p> <pre><code>192.168.1.64 - - [23/Apr/2009:17:04:11 +0100] [domain1.com/sid#813071d0][rid#81783540/initial] (2) init rewrite engine with requested uri /foo 192.168.1.64 - - [23/Apr/2009:17:04:11 +0100] [domain1.com/sid#813071d0][rid#81783540/initial] (3) applying pattern '^/foo/?([0-9a-zA-Z]*)/?(([0-9a-zA-Z/]*))$' to uri '/foo' 192.168.1.64 - - [23/Apr/2009:17:04:11 +0100] [domain1.com/sid#813071d0][rid#81783540/initial] (2) rewrite '/foo' -&gt; '/home/domain2/index.php?controller=foo&amp;action=&amp;params=' 192.168.1.64 - - [23/Apr/2009:17:04:11 +0100] [domain1.com/sid#813071d0][rid#81783540/initial] (3) split uri=/home/domain2/index.php?controller=foo&amp;action=&amp;params= -&gt; uri=/home/domain2/index.php, args=controller=foo&amp;action=&amp;params= 192.168.1.64 - - [23/Apr/2009:17:04:11 +0100] [domain1.com/sid#813071d0][rid#81783540/initial] (2) local path result: /home/domain2/index.php 192.168.1.64 - - [23/Apr/2009:17:04:11 +0100] [domain1.com/sid#813071d0][rid#81783540/initial] (1) go-ahead with /home/domain2/index.php [OK] 192.168.1.64 - - [23/Apr/2009:17:04:11 +0100] [domain1.com/sid#813071d0][rid#8175e4b0/initial] (2) init rewrite engine with requested uri /images/layouts/standard/header/header_logo.gif 192.168.1.64 - - [23/Apr/2009:17:04:11 +0100] [domain1.com/sid#813071d0][rid#8175e4b0/initial] (3) applying pattern '^/foo/?([0-9a-zA-Z]*)/?(([0-9a-zA-Z/]*))$' to uri '/images/layouts/standard/header/header_logo.gif' ... ... </code></pre> <p>Can anyone help with the last step!?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload