Redirection purpose failing in-spite of using .htaccess file.

Redirection purpose failing in-spite of using .htaccess file.

am 13.11.2007 12:09:41 von Ojas

Hi! all,

I hope one of you will come to my help.

I am working on .htaccess file and wish to redirect the control on
matching a pattern to a different server than on which i am working
on. For ex:-

On sending request to http://www.myfirstdomain.com/folder/abc.php?id=1&name=xyz
, the control should be redirected to http://www.myseconddomain.com/folder/abc.php?id=1&di=2
without changing the URL address. I mean i wish to have a Basic
Redirect and not Forcing New Request.

The setting/configuration written by me are as follow:

## if mod_rewrite existing.

Options +FollowSymLinks
RewriteEngine On

# Rules for rewriting URLS.
RewriteRule ^folder/(.*)$ http://www.myseconddomain.com/folder/$1


The strange part is that if i redirect to the local file, then URL
address does not get changed, but when redirected to different domain,
URL address do get changed.

Hope for early response....

Ojasvi

Re: Redirection purpose failing in-spite of using .htaccess file.

am 13.11.2007 13:35:06 von HansH

"Ojas" schreef in bericht
news:1194952181.838930.294650@v2g2000hsf.googlegroups.com...
>
> # Rules for rewriting URLS.
> RewriteRule ^folder/(.*)$ http://www.myseconddomain.com/folder/$1
>
>
> The strange part is that if i redirect to the local file, then URL
> address does not get changed, but when redirected to different domain,
> URL address do get changed.
>
That's by all means the way it is made to be.

While
RewriteRule ^folder/(.*)$ whatever

only changes the mapping of the matching URL to a local file

RewriteRule ^folder/(.*)$ http://www.myseconddomain.com/folder/$1

will tell the browser to retry elsewhere.
The browser is then just showing the URL retrieved.


HansH

Re: Redirection purpose failing in-spite of using .htaccess file.

am 13.11.2007 14:47:28 von phantom

"Ojas" wrote in message
news:1194952181.838930.294650@v2g2000hsf.googlegroups.com...
> Hi! all,
>
> I hope one of you will come to my help.
>
> I am working on .htaccess file and wish to redirect the control on
> matching a pattern to a different server than on which i am working
> on. For ex:-
>
> On sending request to
> http://www.myfirstdomain.com/folder/abc.php?id=1&name=xyz
> , the control should be redirected to
> http://www.myseconddomain.com/folder/abc.php?id=1&di=2
> without changing the URL address. I mean i wish to have a Basic
> Redirect and not Forcing New Request.
>
Maybe you want something like this instead:

ProxyPass /folder/ http://www.myseconddomain.com/folder/

Re: Redirection purpose failing in-spite of using .htaccess file.

am 14.11.2007 04:00:04 von Ojas

On Nov 13, 5:35 pm, "HansH" wrote:
> "Ojas" schreef in berichtnews:1194952181.838930.294650@v2g2000hsf.googlegroups .com...
>
> > # Rules for rewriting URLS.
> > RewriteRule ^folder/(.*)$http://www.myseconddomain.com/folder/$1
> >
>
> > The strange part is that if i redirect to the local file, then URL
> > address does not get changed, but when redirected to different domain,
> > URL address do get changed.
>
> That's by all means the way it is made to be.
>
> While
> RewriteRule ^folder/(.*)$ whatever
>
> only changes the mapping of the matching URL to a local file
>
> RewriteRule ^folder/(.*)$http://www.myseconddomain.com/folder/$1
>
> will tell the browser to retry elsewhere.
> The browser is then just showing the URL retrieved.
>
> HansH

Hi! HansH,

Thanks for your response.

But if the URL does get changed, is there any trick or technique to
not let the end user know that they are accessing some other site than
what they accessed originally?

Ojasvi

Re: Redirection purpose failing in-spite of using .htaccess file.

am 14.11.2007 04:02:08 von Ojas

On Nov 13, 6:47 pm, "phantom" wrote:
> "Ojas" wrote in message
>
> news:1194952181.838930.294650@v2g2000hsf.googlegroups.com... > Hi! all,
>
> > I hope one of you will come to my help.
>
> > I am working on .htaccess file and wish to redirect the control on
> > matching a pattern to a different server than on which i am working
> > on. For ex:-
>
> > On sending request to
> >http://www.myfirstdomain.com/folder/abc.php?id=1&name=xyz
> > , the control should be redirected to
> >http://www.myseconddomain.com/folder/abc.php?id=1&di=2
> > without changing the URL address. I mean i wish to have a Basic
> > Redirect and not Forcing New Request.
>
> Maybe you want something like this instead:
>
> ProxyPass /folder/http://www.myseconddomain.com/folder/

Hi! phantom,

Thanks for replying, but it would very great of you if you can explain
this in more detail or provide an useful link for the same.

Ojasvi.

Re: Redirection purpose failing in-spite of using .htaccess file.

am 14.11.2007 11:38:56 von phantom

"Ojas" wrote in message
news:1195009328.714770.320470@o80g2000hse.googlegroups.com.. .
> On Nov 13, 6:47 pm, "phantom" wrote:
>> "Ojas" wrote in message
>>
>> news:1194952181.838930.294650@v2g2000hsf.googlegroups.com... > Hi! all,
>>
>> > I hope one of you will come to my help.
>>
>> > I am working on .htaccess file and wish to redirect the control on
>> > matching a pattern to a different server than on which i am working
>> > on. For ex:-
>>
>> > On sending request to
>> >http://www.myfirstdomain.com/folder/abc.php?id=1&name=xyz
>> > , the control should be redirected to
>> >http://www.myseconddomain.com/folder/abc.php?id=1&di=2
>> > without changing the URL address. I mean i wish to have a Basic
>> > Redirect and not Forcing New Request.
>>
>> Maybe you want something like this instead:
>>
>> ProxyPass /folder/http://www.myseconddomain.com/folder/
>
> Hi! phantom,
>
> Thanks for replying, but it would very great of you if you can explain
> this in more detail or provide an useful link for the same.
>
> Ojasvi.
http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxypas s