You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Ben Short <be...@benshort.co.uk> on 2010/09/30 15:06:35 UTC
[users@httpd] Re: Rewrite altering path
Hi,
So far I have the following configuration in a vhost
<VirtualHost *:80>
ServerAdmin ben.short@nexusalpha.com
DocumentRoot "/usr/local/apache2/docs/www.mydomain.co.uk/"
ServerName www.mydomain.co.uk
RewriteEngine On
RewriteLog "logs/rewrite.log"
RewriteLogLevel 3
RewriteRule ^(.*)$ /path$1 [L,NC]
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /usr/local/apache2/docs/www.mydomain.co.uk>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
</VirtualHost>
I have a index.html in /usr/local/apache2/docs/www.mydomain.co.uk/path
and it displays when I request www.mydomain.co.uk
When I add in JKMount /* web4 and make the request I get the response
from the index.jsp which is in the root of the webapp.
Any ideas?
Ben
On 30 September 2010 12:18, Ben Short <be...@benshort.co.uk> wrote:
> Hi,
>
> I need to alter the path of my incoming requests for example
>
> www.mydomain.co.uk
>
> should become
>
> to www.mydomain.co.uk/path/
>
> but I need to keep any path that was present in the original request eg:
>
> www.mydomain.co.uk/page1
>
> should become
>
> www.mydomain.co.uk/path/page1
>
>
>
> The browser should not be redirected and the request will then be
> handled by mod_jk which I have working.
>
> Can anyone help me?
>
> Kind Regards
>
> Ben Short
>
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Re: Rewrite altering path
Posted by Rainer Jung <ra...@kippdata.de>.
On 30.09.2010 15:41, Ben Short wrote:
> Fixed. I needed to add the PT flag to the redirect.
For further reference: this topic is somehow explained at
http://tomcat.apache.org/connectors-doc/generic_howto/proxy.html
Regards,
Rainer
> On 30 September 2010 14:06, Ben Short<be...@benshort.co.uk> wrote:
>> Hi,
>>
>> So far I have the following configuration in a vhost
>>
>> <VirtualHost *:80>
>>
>> ServerAdmin ben.short@nexusalpha.com
>> DocumentRoot "/usr/local/apache2/docs/www.mydomain.co.uk/"
>> ServerName www.mydomain.co.uk
>>
>> RewriteEngine On
>> RewriteLog "logs/rewrite.log"
>> RewriteLogLevel 3
>> RewriteRule ^(.*)$ /path$1 [L,NC]
>>
>> <Directory />
>> Options FollowSymLinks
>> AllowOverride None
>> </Directory>
>>
>> <Directory /usr/local/apache2/docs/www.mydomain.co.uk>
>> Options Indexes FollowSymLinks MultiViews
>> AllowOverride None
>> Order allow,deny
>> allow from all
>> </Directory>
>>
>> </VirtualHost>
>>
>> I have a index.html in /usr/local/apache2/docs/www.mydomain.co.uk/path
>> and it displays when I request www.mydomain.co.uk
>>
>> When I add in JKMount /* web4 and make the request I get the response
>> from the index.jsp which is in the root of the webapp.
>>
>> Any ideas?
>>
>> Ben
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> On 30 September 2010 12:18, Ben Short<be...@benshort.co.uk> wrote:
>>> Hi,
>>>
>>> I need to alter the path of my incoming requests for example
>>>
>>> www.mydomain.co.uk
>>>
>>> should become
>>>
>>> to www.mydomain.co.uk/path/
>>>
>>> but I need to keep any path that was present in the original request eg:
>>>
>>> www.mydomain.co.uk/page1
>>>
>>> should become
>>>
>>> www.mydomain.co.uk/path/page1
>>>
>>>
>>>
>>> The browser should not be redirected and the request will then be
>>> handled by mod_jk which I have working.
>>>
>>> Can anyone help me?
>>>
>>> Kind Regards
>>>
>>> Ben Short
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
[users@httpd] Re: Rewrite altering path
Posted by Ben Short <be...@benshort.co.uk>.
Fixed. I needed to add the PT flag to the redirect.
On 30 September 2010 14:06, Ben Short <be...@benshort.co.uk> wrote:
> Hi,
>
> So far I have the following configuration in a vhost
>
> <VirtualHost *:80>
>
> ServerAdmin ben.short@nexusalpha.com
> DocumentRoot "/usr/local/apache2/docs/www.mydomain.co.uk/"
> ServerName www.mydomain.co.uk
>
> RewriteEngine On
> RewriteLog "logs/rewrite.log"
> RewriteLogLevel 3
> RewriteRule ^(.*)$ /path$1 [L,NC]
>
> <Directory />
> Options FollowSymLinks
> AllowOverride None
> </Directory>
>
> <Directory /usr/local/apache2/docs/www.mydomain.co.uk>
> Options Indexes FollowSymLinks MultiViews
> AllowOverride None
> Order allow,deny
> allow from all
> </Directory>
>
> </VirtualHost>
>
> I have a index.html in /usr/local/apache2/docs/www.mydomain.co.uk/path
> and it displays when I request www.mydomain.co.uk
>
> When I add in JKMount /* web4 and make the request I get the response
> from the index.jsp which is in the root of the webapp.
>
> Any ideas?
>
> Ben
>
>
>
>
>
>
>
>
>
> On 30 September 2010 12:18, Ben Short <be...@benshort.co.uk> wrote:
>> Hi,
>>
>> I need to alter the path of my incoming requests for example
>>
>> www.mydomain.co.uk
>>
>> should become
>>
>> to www.mydomain.co.uk/path/
>>
>> but I need to keep any path that was present in the original request eg:
>>
>> www.mydomain.co.uk/page1
>>
>> should become
>>
>> www.mydomain.co.uk/path/page1
>>
>>
>>
>> The browser should not be redirected and the request will then be
>> handled by mod_jk which I have working.
>>
>> Can anyone help me?
>>
>> Kind Regards
>>
>> Ben Short
>>
>
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org