CLR Benjamin
asked on
Rewrite URL - Keep the URL from a HTML page
Hi,
I have an internal site: http://old.intranet.contoso.fr/organigrammeFR.html
I want to redirect this URL: organigramme.contoso.com to http://old.intranet.contoso.fr/organigrammeFR.html.
IIS server (IIS 6.1) is mounted with redirect url and it works. But in the brower old.intranet.contoso.fr/or ganigramme FR.html is displayed instead of organigramme.consoto.com.
How to redirect the html page to the website and keep the new url?
Thanks in advance
I have an internal site: http://old.intranet.contoso.fr/organigrammeFR.html
I want to redirect this URL: organigramme.contoso.com to http://old.intranet.contoso.fr/organigrammeFR.html.
IIS server (IIS 6.1) is mounted with redirect url and it works. But in the brower old.intranet.contoso.fr/or
How to redirect the html page to the website and keep the new url?
Thanks in advance
ASKER
Thanks David,
But it doesn't work:
<rule name="Proxy">
<match url="(.*)" />
<conditions>
<add input="{CACHE_URL}" pattern="^http://old.intranet.contoso.fr/organigrammeFR.html" />
</conditions>
<action type="Rewrite" url="{C:1}://organigramme. contoso.co m{R:1}" />
</rule>
embed=file 1328241]
capt3.JPG
But it doesn't work:
<rule name="Proxy">
<match url="(.*)" />
<conditions>
<add input="{CACHE_URL}" pattern="^http://old.intranet.contoso.fr/organigrammeFR.html" />
</conditions>
<action type="Rewrite" url="{C:1}://organigramme.
</rule>
embed=file 1328241]
capt3.JPG
<rule name="Proxy">
<match url="(.*)" />
<conditions>
<add input="{CACHE_URL}" pattern="^(https?)://" />
</conditions>
<action type="Rewrite" url="{C:1}://organigramme. contoso.co m{R:1}" />
</rule>
I think it has to be something like this. No credits for guessing this :-)
<match url="(.*)" />
<conditions>
<add input="{CACHE_URL}" pattern="^(https?)://" />
</conditions>
<action type="Rewrite" url="{C:1}://organigramme.
</rule>
I think it has to be something like this. No credits for guessing this :-)
ASKER
Not working, always the same problem with this conf:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<httpRedirect enabled="true" destination="http://org.contoso.com/" exactDestination="true" childOnly="false" httpResponseStatus="Permanent" />
<rewrite>
<rules>
<rule name="Proxy">
<match url="(.*)" />
<conditions>
<add input="{CACHE_URL}" pattern="^(https?)://" />
</conditions>
<action type="Rewrite" url="{C:1}://organigramme.contoso.com{R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
Are you trying to pass parameters as well, then ({R:1} construct is incorrect.
Quoting from Scott Gu's blog:
Fro more explanation see Step 3: Setup a Permanent Redirect Action in this link.
Quoting from Scott Gu's blog:
The "{R:N}" regex construct, where N >= 0, is called a regular expression back-reference and N is the back-reference index. In the case of our pattern "(.*?)/?Default\.aspx$", if the input URL is "products/Default.aspx" then {R:0} will contain "products/Default.aspx" and {R:1} will contain "products". We are going to use this {R:1}/ value to be the URL we redirect users to.
Fro more explanation see Step 3: Setup a Permanent Redirect Action in this link.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window