rewriterule shows wrong URL

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 5
Joined: 19 Feb 2016, 07:54

rewriterule shows wrong URL

19 Feb 2016, 08:22

Hi,
I have a webapplication working on:
next3.info:83

I want to go there with:
weburen.next3.nl so I used this code:
RewriteEngine on
RewriteCond %{HTTP_HOST} =weburen.next3.nl
RewriteCond %{SERVER_PORT} !^83
RewriteRule ^(.*) http://next3.info:83/ [L]
It goes to:
next3.info:83 so the redirect works

But I want to see:
weburen.next3.nl not next3.info:83
How can I make this work?

User avatar
Posts: 402
Joined: 06 Mar 2012, 11:59

Re: rewriterule shows wrong URL

19 Feb 2016, 10:58

Hello.

I suppose you need a reverse proxy, instead of redirect. Try these rules instead:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^weburen\.next3\.nl$ [NC]
RewriteRule ^(.*) http://next3.info:83$1 [P]

User avatar
Posts: 5
Joined: 19 Feb 2016, 07:54

Re: rewriterule shows wrong URL

19 Feb 2016, 12:23

Hi,

Thx for your answer, but it still says http://next3.info:83/

User avatar
Posts: 402
Joined: 06 Mar 2012, 11:59

Re: rewriterule shows wrong URL

19 Feb 2016, 13:20

Hello.

The rule is supposed to be on a weburen.next3.nl machine and you are supposed to enter weburen.next3.nl in the browser. The request will then be shadow proxied from weburen.next3.nl to next3.info:83

User avatar
Posts: 5
Joined: 19 Feb 2016, 07:54

Re: rewriterule shows wrong URL

19 Feb 2016, 13:42

Ok
But what should I do to keep weburen.next3.nl as the visable URL?

User avatar
Posts: 402
Joined: 06 Mar 2012, 11:59

Re: rewriterule shows wrong URL

21 Feb 2016, 12:15

There is a redirect to http://next3.info:83/ on your site. It is either one of the ISAPI_Rewrite rules which you didn't show or an underlying application issuing this redirect. I suppose the latter.
First please show your exact and complete ISAPI_Rewrite configuration.
If it is underlying application issues a redirect you need to fix it in the application itself. Probably there is some setting in it, etc.

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 12 guests