Quantcast
Channel: URL Rewrite Module
Viewing all 2482 articles
Browse latest View live

Rewrite Map, with text file

$
0
0

Good Afternoon,

In Apache HTACCESS which I'm more familiar with working with you can reference a text file with all the URLS you want to redirect.

eg: /home.html,/home.aspx

This would be in the text file, then in the main config file, you reference the file and set the redirects. Can this be done in the IIS?


Where are rules stored and how can I edit them

$
0
0

Hi,

I have inherited an IIS 8 server which behaves strange. If I access the root website,http://www.my-domain.com I am automatically redirected tohttp://my-domain.com/client. In fact, every hostname I used which resolves to server's IP address is redirected to the same URL, abc.my-domain.com, xyz.my-domain.com, etc are redirected to my-domain.com/client. I want to control this behavior, but I don't know how. The URL rewrite module is not installed, as far as I can tell, and there is no http redirect rule.

Please help.

Thank you,

Marius

Inner WebPage Redirect Rule

$
0
0

Hi,

I need inner page Redirect Rule for testimonials.html?id=0 to testimonials.html

anyone can guide me..

URL rewrite rule to hide all the extension name

urlrewrite does not work for one rule

$
0
0

Hi,

We have tons of rewrite rules likes these, but somehow /bakkersliedrecht does get translate into the wrong destination:

What did we do wrong?

OldUrl/bakkersliedrecht/
NewUrlhttp://192.168.57.10:9000/bakkersliedrecht/

        <rule name="ReverseProxyInboundRuleAB" stopProcessing="true">
                    <match url="(.*)" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
                        <add input="{URL}" matchType="Pattern" pattern="^/ab*" ignoreCase="true" negate="false" />
                    </conditions>
                    <serverVariables>
                        <set name="HTTP_X_ORIGINAL_ACCEPT_ENCODING" value="{HTTP_ACCEPT_ENCODING}" />
                        <set name="HTTP_ACCEPT_ENCODING" value="" />
                    </serverVariables>
                    <action type="Rewrite" url="http://192.168.57.10:9000/{R:1}" logRewrittenUrl="true" />
                </rule>

  <rule name="ReverseProxyInboundRuleBAKKERSLIEDRECHT" stopProcessing="true">
                    <match url="(.*)" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
                        <add input="{URL}" pattern="^/bakkersliedrecht*" />
                    </conditions>
                    <serverVariables>
                        <set name="HTTP_X_ORIGINAL_ACCEPT_ENCODING" value="{HTTP_ACCEPT_ENCODING}" />
                        <set name="HTTP_ACCEPT_ENCODING" value="" />
                    </serverVariables>
                    <action type="Rewrite" url="http://192.168.57.10:9005/{R:1}" logRewrittenUrl="true" />
                </rule>

Rewrite a domain

$
0
0

Hi all, a newbie to Rewriting here. i am trying to re-write a entire domain so the following is true:

www.domain1.com

is re-written to:

www.ourdomain.gov.uk/domain1/

at the moment i have the following:

  <rule name="domain1" enabled="true" stopProcessing="true">
                    <match url=".*" />
                    <conditions>
                        <add input="{HTTP_HOST}" pattern="^(www.)?domain1.com$" />
                    </conditions>
                    <action type="Rewrite" url="https://www.ourdomain.gov.uk/domain1/home/{R:0}" />

</rule>

If i take the/home/ bit off the rewrite URL it doesnt work. does anyone know what the problem is? i don't have any outbound rules, not sure if that is a problem?

match pattern # rewrite to #\

$
0
0

Dear all,

I am new to IIS. Normally I would use a .htaccess for this issue, but I found this nice menue which I want to use.

(InternetInformationServiceManager with rewriteModul)

These are some of my url's I want to get rewrite:

I put this into my browser: http://192.168.0.126/index.html

I receive this: http://192.168.0.126/index.html#/news/?_k=8p9xmp

First thing: It would be great to get this run without index.html

Second thing: the "#" would be great to get this in a way like this:

http://192.168.0.126/index.html/#/news/?_k=8p9xmp

or this: http://192.168.0.126/#/news/?_k=8p9xmp

Can anyone give me a hand? A solution with .htaccess would also be great.

Best Regards,

Heinz

Redistribution of URL Rewrite Module allowed?

$
0
0

Hi,

As the setup of our software installing IIS during setup phase, we would like to install the URL Rewrite Module as well. At the moment I don't find any clear statement if the redistribution of the MSI is allowed or not.

Anyone of you knows more about this topic?

Thanks for you help.


URL Rewrite with Content Tag Content

$
0
0

As per https://forums.iis.net/t/1170430.aspx , is there any way to narrow the search to the content of a content tag itself?

Has anything changed or been added since 2010 that I'm unaware of :)?

E.g. perhaps leaving the "attribute" blank should look (and rewrite) the content?

A full-page response re-write is inefficient :(

UrlRewrite provider exception

$
0
0

Hi,

i am using textfile provider rule for my website. i have added provider like below

<provider name="Filemap2" type="FileMapProvider, Microsoft.Web.Iis.Rewrite.Providers, Version=7.1.761.0, Culture=neutral, PublicKeyToken=0545b0627da60a5f">
<settings>
<add key="FilePath" value="path where .txt file will be there" />
<add key="IgnoreCase" value="1" />
<add key="Separator" value="," />
</settings>
</provider>

but when i run the site. it was throwing exception related to Microsoft.Web.Iis.Rewrite.Providers. dll , when i was check for this dll in assembly it is not there. so how to get this dll. pls help on this

Regards,

Anil N

<

help with rewrite rule

URL Rewrite the right tool for what I want?

$
0
0

I'm a relative IIS newb, so bear with me.

I have a site: http://servername.fqdn.com/application

I have a DNS alias friendlyname.fqdn.com that points to servername.fqdn.com

I want it so that when a user inputs http://friendlyname.fqdn.com into their browser it automatically takes them tohttp://servername.fqdn.com/application

I created a URL rewrite on the top level default website on servername.fqdn.com that sends the user to the appropriate site. However, when I test it by going tohttp://friendlyname.fqdn.com I get 403.18 forbidden (The specified request cannot be processed in the application pool that is configured for this resource on the Web server.).

What can I do to make this work?

HTTPS Post rewrite is being sent as GET? (Reverse Proxy with IIS 8.0, URL Rewrite 2.0, and ARR 3.0)

$
0
0

Hello,

I am trying to implement a reverse proxy in my DMZ that takes a HTTPS POST request from a user and sends it to an internal server. The issue I am having is the HTTPS POST from the vendor seems to be getting converted into a GET request when it is being rewritten via URL Rewrite. This is of course causing issues and I am trying to understand what is causing it. The logs show the POST getting a 302 status code then rewriting as a GET getting 405 status code. The internal server is serving a 405 - GET method not supported as the internal server is expecting a POST. Is there something that needs to be done differently for the POST to not get rewritten as a GET?

The rewrite rule is below. I have only modified the URLs and IPs for security. 

<rule name="ReverseProxyInboundRule" stopProcessing="true">

<match url="(.*)" />
<action type="Rewrite" url="https://internal-server.domain.net:1443/folder1/folder2/action.do?paramater=FUNCTION" appendQueryString="true" logRewrittenUrl="true" />
<conditions>
</conditions>
</rule>

Thanks,
Mack

IIS 10 - Http to https: 310 ERR_TOO_MANY_REDIRECTS

$
0
0

Hi,

I have default IIS site with bindings for http and https without SNI. I'm getting ERR_TOO_MANY_REDIRECTS after configuring rewrite rule in URL Rewrite Module.

Code:

<rewrite><rules><rule name="Http to Https" stopProcessing="true"><match url="(.*)" /><conditions trackAllCaptures="true"><add input="{HTTPS}" pattern="off" /></conditions><action type="Redirect" url="https://{HTTP_HOST}/{R:1}" appendQueryString="true" redirectType="Permanent" /></rule></rules></rewrite><tracing><traceFailedRequests><add path="*"><traceAreas><add provider="WWW Server" areas="WebSocket" verbosity="Verbose" /></traceAreas><failureDefinitions statusCodes="200-399" /></add></traceFailedRequests></tracing>

Code above is resulting into ERR_TOO_MANY_REDIRECTS . I have enabled Trace Failed Requests. I have zero logs from that feature :/

When I disable rule and enter in browser by myself https:// its working and also seeing green bar. Using certificate from Cloudflare.

Only anonymous authentication is allowed for default website.

SSL Settings is unchecked, in client certificates is checked Ignore.

Using URL Rewrite version 2.0

OS: Window server 2016

Thanks for help

Redirect HTTP/HTTPS to HTTPS FQDN

$
0
0

I am trying to redirect all incoming requests to HTTPS FQDN.  This is to ensure there are no cert errors.

I have tired the following from this post (https://forums.iis.net/t/1186288.aspx?Redirect+all+incoming+traffic+to+FQDN+with+SSL).

I have tried the following test conditions.  All seem to work as expected except one.

Redirect successful
https://MyServername.MyDomain.com/cutepuppies
http://MyServername.MyDomain.com/cutepuppies
https://MyServername.MyDomain.com/
https://MyServername.MyDomain.com
http://MyServername.MyDomain.com/
http://MyServername.MyDomain.com
http://MyServername
http://MyServername/

Redirect NOT successful
https://MyServername
https://MyServername/

Here is the rules I have tied.

Rules 1

<rewrite>
   <rules>
                <clear />
                <rule name="Redirect2FQDN" stopProcessing="true">
                    <match url="(.*)" />
                    <conditions logicalGrouping="MatchAny" trackAllCaptures="false">
                        <add input="{HTTP_HOST}" pattern="^([^\.]+)$" />
                    </conditions>
                    <action type="Redirect" url="https://{HTTP_HOST}.MyDomain.com/{R:0}" />
                </rule>
                <rule name="RedirectToHTTPS" stopProcessing="true">
                    <match url="(.*)" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
                        <add input="{HTTPS}" pattern="^OFF$" />
                    </conditions>
                    <action type="Redirect" url="https://{HTTP_HOST}/{R:0}" />
                </rule>
   </rules>

Rules 2

<rewrite>
   <rules>
                <clear />
                <rule name="redirect https://MyServername to fqdn" stopProcessing="true">
                    <match url="(.*)" ignoreCase="false" />
                    <conditions logicalGrouping="MatchAny" trackAllCaptures="false">
                        <add input="{HTTP_HOST}" pattern=".*MyServername$" />
                        <add input="{HTTP_HOST}" pattern=".*MyServername/$" />
                    </conditions>
                    <action type="Redirect" url="https://{HTTP_HOST}.MyDomain.com/{R:0}" appendQueryString="true" />
                </rule>
                <rule name="Redirect2FQDN" stopProcessing="true">
                    <match url="(.*)" />
                    <conditions logicalGrouping="MatchAny" trackAllCaptures="false">
                        <add input="{HTTP_HOST}" pattern="^([^\.]+)$" />
                    </conditions>
                    <action type="Redirect" url="https://{HTTP_HOST}.MyDomain.com/{R:0}" />
                </rule>
                <rule name="RedirectToHTTPS" stopProcessing="true">
                    <match url="(.*)" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
                        <add input="{HTTPS}" pattern="^OFF$" />
                    </conditions>
                    <action type="Redirect" url="https://{HTTP_HOST}/{R:0}" />
                </rule>
   </rules>
 </rewrite>

No matter what I try, I cannot get HTTPS://MyServername to redirect toHTTPS://MyServername.MyDomain.com.

Any suggestions?

Thanks in advance,


Redirect to URL alias

$
0
0

Hello!

I have site which url's have aliases. You can access for example one article with two addresses:

https://bglog.net/Zdrave/9624 which is unaliased url

and

https://bglog.net/Zdrave/post/%D0%9A%D0%BB%D0%B0%D1%81%D0%B8%D1%87%D0%B5%D1%81%D0%BA%D0%B0%D1%82%D0%B0-%D1%80%D0%B5%D1%86%D0%B5%D0%BF%D1%82%D0%B0-%D0%B7%D0%B0-%D0%BF%D0%B0%D0%BB%D0%B0%D1%87%D0%B8%D0%BD%D0%BA%D0%B8 which is the correct aliased url. 

The problem is that Google indexes often the unaliased url. All the site have references to aliased urls, not unaliased. The aliased url can be specified when the user prepare the post or is automatically created from the post title.

So the unaliased url is not visible. But Google somehow index it. I want to redirect to aliased URL, but I am unable to find how to do that with URL Rewrite. Please help! Thank you!

Redirecting Similar URLs

$
0
0

I am working through redirecting the URLs of our old site to our newly created site.  All the redirecting rules I created work fine as expected except for a series of URLs that have the same .aspx file.  Each URL that is not working has a page.aspx extension followed by a unique identifier.  The issue I am running into is I can get the first url with the page.aspx to redirect just fine but the subsequent rules I create for the similar urls with the page.aspx redirect to the original rule's redirected url.  As if the newly created rule does not see the unique identifier of each page.aspx file.  I don't work a lot with IIS so any help or advice would be greatly appreciated.

URL_Rewrite - Adding Server variable in the we.config file ?

$
0
0

Hi,

For the URL_REWRITE module it's possible to add server variable via the following menu option "URL Rewrite -> View Server Variables -> Add".

Is it possible to specify the server variable in the configuration file itself 'web.config'. so that it takes the settings globally. 

Thanks,

Bhindusaran.v

 

Need help with rewrite rule to replace domain for some specific login ids

$
0
0

Currently I have installed "IIS URL Rewrite Module 2" on my Server (Windows Server 2008 R2 Standard) with IIS 7.5.

At the "Default Web Site" Level, I have installed the following rule which works fine:

        <rewrite>
            <rules>
             <rule name="Root Hit Redirect" stopProcessing="true">
              <match url="^$" />
               <action type="Redirect" url="/TEST/Login.aspx?guestlogin_id=1" />
             </rule>
            </rules>
        </rewrite>

But now I want to install an additional rewrite rule which should do the following:

Every link which includes "guestlogin_id=999" or "guestlogin_id=888" should be changed, so that

the Domain is replaced by another.

Example:

http://mydomain.test.org/TEST/Login.aspx?guestlogin_id=999?tzo=90

should be changed to

http://newdomain.test.org/TEST/Login.aspx?guestlogin_id=999?tzo=90

The rule should be able to handle it like *guestlogin_id=999* or *guestlogin_id=888*

then replace "mydomain" to "newdomain".

Is this possible? Can someone please help me with this?

Thanks in advanced.

Regarding web.config and IIS rewrite statement

$
0
0
<div>

i not familiar with IIS rewrite related code written in web.config file.

see the below code and tell me the meaning please what the below two rule will do?

<rulename="Always redirect country root extensionless path to index.aspx"stopProcessing="true"><matchurl=".*"/><conditionstrackAllCaptures="true"><addinput="{REQUEST_URI}"pattern="^[a-z]{2}"/><addinput="{URL}"pattern="^[a-z]{2}"/></conditions><actiontype="Rewrite"url="/{R:0}/index.aspx"appendQueryString="true"logRewrittenUrl="true"/></rule><rulename="Always redirect root extensionless path to index.aspx"stopProcessing="true"><matchurl="^$"/><actiontype="Redirect"url="/index.aspx"appendQueryString="true"logRewrittenUrl="true"/></rule>

from our web site we add country code before page url. when user come to our web site then url look like

www.mysite.com/uk/index.aspx but there is one index file exist in root and no folder exist called us or uk. so tell me how the above in bound rules redirect user to index.aspx file and ignore country code in url ?

does the above rule add the country code as query string internally like www.mysite.com/index.aspx?countrycode=uk ?

please guide me in details about the above rules like what it will do ?

thanks

</div>
Viewing all 2482 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>