Rewrite altering path

Rewrite altering path

am 30.09.2010 13:18:49 von ben short

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 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: Rewrite altering path

am 30.09.2010 15:06:35 von ben short

Hi,

So far I have the following configuration in a vhost



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]


Options FollowSymLinks
AllowOverride None



Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all




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 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 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: Rewrite altering path

am 30.09.2010 15:41:27 von ben short

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

On 30 September 2010 14:06, Ben Short wrote:
> Hi,
>
> So far I have the following configuration in a vhost
>
>
>
> 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]
>
>
> =A0 =A0Options FollowSymLinks
> =A0 =A0AllowOverride None
>

>
>
> =A0 =A0Options Indexes FollowSymLinks MultiViews
> =A0 =A0AllowOverride None
> =A0 =A0Order allow,deny
> =A0 =A0allow from all
>

>
>

>
> 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 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 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: Re: Rewrite altering path

am 30.09.2010 15:58:47 von Rainer Jung

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 wrote:
>> Hi,
>>
>> So far I have the following configuration in a vhost
>>
>>
>>
>> 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]
>>
>>
>> Options FollowSymLinks
>> AllowOverride None
>>

>>
>>
>> Options Indexes FollowSymLinks MultiViews
>> AllowOverride None
>> Order allow,deny
>> allow from all
>>

>>
>>

>>
>> 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 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 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