Masking redirect?

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 4
Joined: 20 Feb 2015, 06:07

Masking redirect?

20 Feb 2015, 06:10

Hi I have some rules on a proxy server that will redirect to another domain but I wanna mask it. Is this possible?

Right now I have :

RewriteCond %{HTTP_Host} ^somedomain.co.uk$
RewriteProxy ^/(/)?$ http\://otherdomain.co.uk/hub/3/Home [NC,U,L,R]

It redirects fine but it does not mask the URL, is there any way to mask it please?

Many thanks!

User avatar
Posts: 4
Joined: 20 Feb 2015, 06:07

Re: Masking redirect?

20 Feb 2015, 06:58

Also is there any way to redirect somedomain.co.uk to otherdomain.co.uk ? Right now the above rule doesn't work, but if I type in http://otherdomain.co.uk/hub/3/Home in the browser it works fine...

Instead of RewriteProxy, I also tried RewriteRule but no luck...

User avatar
Posts: 871
Joined: 12 Mar 2012, 09:54

Re: Masking redirect?

20 Feb 2015, 07:12

Hello,

The rule you provided is a mixture of redirect and proxy.
To mask redirect to another domain you need proxy:

RewriteCond %{HTTP_Host} ^somedomain\.co\.uk$
RewriteProxy (.*) http://otherdomain.co.uk/hub/3/Home/$1 [NC]

If it doesn't work as expected, please enable logging in httpd.conf by putting

RewriteLogLevel 9

and provide rewrite.log records for the test request.

User avatar
Posts: 4
Joined: 20 Feb 2015, 06:07

Re: Masking redirect?

20 Feb 2015, 09:00

Hi I have switched on log level 9 and here's what I got in Rewrite.log:

86.170.251.28 86.170.251.28 Fri, 20-Feb-2015 11:53:52 GMT [otherdomain.co.uk/sid#1][rid#409924185048/initial] (2) init rewrite engine with requested uri /store/ShowMessage.aspx?checkcookie=true&c=1&StoreID=-1&ErrorCode=3
86.170.251.28 86.170.251.28 Fri, 20-Feb-2015 11:53:52 GMT [otherdomain.co.uk/sid#1][rid#409924185048/initial] (1) Htaccess process request C:\Program Files\Helicon\ISAPI_Rewrite3\httpd.conf
86.170.251.28 86.170.251.28 Fri, 20-Feb-2015 11:53:52 GMT [otherdomain.co.uk/sid#1][rid#409924185048/initial] (3) applying pattern '(.*)' to uri '/ustore/ShowMessage.aspx'
86.170.251.28 86.170.251.28 Fri, 20-Feb-2015 11:53:52 GMT [otherdomain.co.uk/sid#1][rid#409924185048/initial] (4) RewriteCond: input='rpmxmedia.co.uk' pattern='^ somedomain\.co\.uk$' => not-matched

My problem is the rule as specified: http://otherdomain.co.uk/store/3/home when typed in a browser it works, but when the rule is defined, and the somedomain.co.uk is visited, it supposedly redirects to http://otherdomain.co.uk/store/3/home however goes to http://otherdomain.co.uk/store/ShowMess ... rrorCode=3

I don't know where that came from?! BTW http://otherdomain.co.uk/store/3/home is also using Helicon to redirect to actually http://otherdomain.co.uk/store/login.aspx?storeid=3

User avatar
Posts: 871
Joined: 12 Mar 2012, 09:54

Re: Masking redirect?

20 Feb 2015, 10:07

Hello,

From the log I see that you use 'somedomain' and 'otherdomain' as is which are not your real domain names.
Can you show me all the rules you have for each site.
And provide the log after you fix the domains in the rules so that it becomes:
RewriteCond: input='rpmxmedia.co.uk' pattern='^rpmxmedia\.co\.uk$' => matched

User avatar
Posts: 4
Joined: 20 Feb 2015, 06:07

Re: Masking redirect?

20 Feb 2015, 13:36

Thanks, actually can I email to get support instead as I prefer not to open my client's rules. Thanks

User avatar
Posts: 871
Joined: 12 Mar 2012, 09:54

Re: Masking redirect?

22 Feb 2015, 09:42

I've already responded to your email. Let's continue our communication there.

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 14 guests