Rewrite altering path

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 [at] httpd.apache.org
" from the digest: users-digest-unsubscribe [at] httpd.apache.org
For additional commands, e-mail: users-help [at] httpd.apache.org
ben short [ Do, 30 September 2010 13:18 ] [ ID #2048520 ]

Re: Rewrite altering path

Hi,

So far I have the following configuration in a vhost

<VirtualHost *:80>

ServerAdmin ben.short [at] 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 <ben [at] 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 [at] httpd.apache.org
" from the digest: users-digest-unsubscribe [at] httpd.apache.org
For additional commands, e-mail: users-help [at] httpd.apache.org
ben short [ Do, 30 September 2010 15:06 ] [ ID #2048523 ]

Re: Rewrite altering path

Fixed. I needed to add the PT flag to the redirect.

On 30 September 2010 14:06, Ben Short <ben [at] benshort.co.uk> wrote:
> Hi,
>
> So far I have the following configuration in a vhost
>
> <VirtualHost *:80>
>
> ServerAdmin ben.short [at] 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 />
> =A0 =A0Options FollowSymLinks
> =A0 =A0AllowOverride None
> </Directory>
>
> <Directory /usr/local/apache2/docs/www.mydomain.co.uk>
> =A0 =A0Options Indexes FollowSymLinks MultiViews
> =A0 =A0AllowOverride None
> =A0 =A0Order allow,deny
> =A0 =A0allow 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 <ben [at] 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 [at] httpd.apache.org
" from the digest: users-digest-unsubscribe [at] httpd.apache.org
For additional commands, e-mail: users-help [at] httpd.apache.org
ben short [ Do, 30 September 2010 15:41 ] [ ID #2048524 ]

Re: Re: Rewrite altering path

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<ben [at] benshort.co.uk> wrote:
>> Hi,
>>
>> So far I have the following configuration in a vhost
>>
>> <VirtualHost *:80>
>>
>> ServerAdmin ben.short [at] 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<ben [at] 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 [at] httpd.apache.org
" from the digest: users-digest-unsubscribe [at] httpd.apache.org
For additional commands, e-mail: users-help [at] httpd.apache.org
Rainer Jung [ Do, 30 September 2010 15:58 ] [ ID #2048525 ]
Webserver » gmane.comp.apache.user » Rewrite altering path

Vorheriges Thema: Does Apache 2.2.14 run on WIN2008 OS's
Nächstes Thema: "proxy_balancer" | stickysession