Apache Server configuration support - Redirection purpose failing in-spite of using .htaccess file.

This is Interesting: Free IT Magazines  
Home > Archive > Apache Server configuration support > November 2007 > Redirection purpose failing in-spite of using .htaccess file.





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

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

2007-11-13, 7:36 am

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...p?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.
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On

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

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

HansH

2007-11-13, 7:36 am

"Ojas" <contactojas@gmail.com> schreef in bericht
news:1194952181.838930.294650@v2g2000hsf.googlegroups.com...
>
> # Rules for rewriting URLS.
> RewriteRule ^folder/(.*)$ http://www.myseconddomain.com/folder/$1
> </IfModule>
>
> 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


phantom

2007-11-13, 1:30 pm

"Ojas" <contactojas@gmail.com> 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...p?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/


Ojas

2007-11-14, 1:39 am

On Nov 13, 5:35 pm, "HansH" <ha...@invalid.invalid> wrote:
> "Ojas" <contacto...@gmail.com> schreef in berichtnews:1194952181.838930.294650@v2g2000hsf.googlegroups.com...
>
>
>
> 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

Ojas

2007-11-14, 1:39 am

On Nov 13, 6:47 pm, "phantom" <nob...@blueyonder.invalid> wrote:
> "Ojas" <contacto...@gmail.com> wrote in message
>
> news:1194952181.838930.294650@v2g2000hsf.googlegroups.com...> Hi! all,
>
>
>
>
> 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.

phantom

2007-11-14, 7:38 am


"Ojas" <contactojas@gmail.com> wrote in message
news:1195009328.714770.320470@o80g2000hse.googlegroups.com...
> On Nov 13, 6:47 pm, "phantom" <nob...@blueyonder.invalid> wrote:
>
> 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/mo....html#proxypass


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com