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

Azure IIS routing with Angular2 --> 404


Redirect to HTTP non-www to HTTPS www with htaccess

$
0
0

I intended to redirect non-www to www and http to https. For that I have used below code and it's resolving perfectly. Please check whether code is correct or not.

RewriteEngine On
RewriteBase /
#Redirect non-www to www

RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

# Redirect to HTTPS
RewriteCond %{HTTPS} off
RewriteRule (.*) https://www.pnrstatusbuzz.in/ %{REQUEST_URI}

Thank You.

redirect from one domain to another (with different canonical url's)

$
0
0

I need to redirect a site that has slightly different urls to a new site but every time it just redirects to the base url.

Here is my web.config file

<rewrite><rewriteMaps configSource="rewritemaps.config" /><rules><rule name="Redirect oldsite.com to newsite.com" stopProcessing="true"><match url=".*" /><conditions><add input="{HTTP_HOST}" pattern="^www.oldsite.com$" /></conditions><action type="Redirect" url="https://www.newsite.com" redirectType="Permanent" appendQueryString="false" /></rule></rules></rewrite>

And here is my external file containing some simple rules

<rewriteMaps><rewriteMap name="Redirects"><add key="/checkout/cart/" value="/cart"/><add key="/contacts" value="/ContactUs"/><add key="/contact-us" value="/ContactUs"/><add key="/customer/account/" value="/customer/info"/><add key="/customer/account/login/" value="/login"/><add key="/customer-service" value="/why-us"/><add key="/sales/guest/form/" value="/order/history"/><add key="/why-us-cat/about-us-cat" value="/about-us-2"/></rewriteMap></rewriteMaps>

So if i hit www.oldsite.com/contacts , i would expect it to redirect to www.newsite.com/ContactUs but it just redirects to www.newsite.com.

rule to strip out one query string parameter

$
0
0

Hello all,

A request came down to me to remove one query string value from a request URL. So I have the case where users pull up a URL in several different possible ways:

http://www.example.com/test/url?value1=XXX&value2=YYY&value3=ZZZ

OR

http://www.example.com/test/url?value2=YYY&value1=XXX&value3=ZZZ

OR

http://www.example.com/test/url?value1=XXX&value3=ZZZ&value2=YYY

For all three of these possible options, I want to remove the "value2=YYY" query string parameter, and send the user tohttp://www.example.com/test/url?value1=XXX&value3=ZZZ

Does anyone know how to do this? I was able to create 3 separate rules to match on the possibility of value2=YYY being at different spots in the query string, but I'm drawing a blank on always redirecting the user to the initial URL before the query string, which might not necessarily be the same for each user.

Thanks,

Sheel Shah

Rewrite rule can't show correctly

$
0
0

Hi,

I'm learning how to use URL rewrite recently. I aimed to redirect http://mysite.com/b->http://mysite/a/b. So I created the following rewrite rule:

<rule name="rewrite rule" enabled="true" stopProcessing="true"><match url="(.*)" /><action type="Redirect" url="a/b" redirectType="Temporary" /><conditions><add input="{REQUEST_URI}" pattern="b" /></conditions>

The problem I got is when I am runing the URL, the rewrite rule didn't work correctly. What's more, after few minutes loading, I got the error message ' page can't be loaded'. I'm wondering how to configure the rewriterule correctly. Any suggestions will be apprciated.

URL Rewrite Error Upon Install

$
0
0

Hello,

I am receiving an error 2503 and 2502 when attempting to install URL Rewrite 2.0 on my server with IIS 8.5. Has anyone experienced this issue? My main goal is to get rid of the server header that is showing my IIS version.

Is both HTTP and HTTPS versions should be verified in Webmaster Tools?

$
0
0

I am struggling to get solution of issue which i am currently facing. Lately, we have upgraded our website with SSL and redirected the entire site from http to https with all urls. The site is currently added to Google Webmaster Tools as www.pnrstatusbuzz.in and all the pages are indexed without using SSL. Do I just submit a updated sitemap which has the HTTPS URLs or Do I add a new site ashttps://www.pnrstatusbuzz.in and submit the sitemap with HTTPS urls?

http to http redirect

$
0
0

Hello,

I'm currently trying to redirect http traffic t http traffic on my website. I have followed the exact instruction here but its still not working

http://www.jppinto.com/2010/03/automatically-redirect-http-requests-to-https-on-iis7-using-url-rewrite-2-0/

in IIS, i have binding the certificate to port 443. if i browse my website using http. it failed

if i add port 80 under binding and try to browse using http, it just connects to the http site and would not redirect.

i know i have missed something but i was wondering if any of the IIS experts have any knowledge of this? What exactly am i doing wrong? do i need to had port 80 under binding. If yes, why is it resolving to 80 and not 443 when the url rewrite is in place?


Redirect from default page in IIS...

$
0
0

I am sure this should be easy, but I have been unable to get this working using the URL Rewrite module.

I am simply trying to get https://www.mysite.com to redirect to another pagehttps://www.mysite.com/a/b.dll

I am wondering whether the default document handling is conflicting with the rules and rewrite maps I have created.

If it is possible to do this, can someone provide an example web.config of how this is done.

Thanks and apologies if this question has been asked in the past!

ForumFirstTimer

Adding a subfolder for redirects

$
0
0

Question about outbound rule

$
0
0

Hi
Thanks everyone that help me resolve the previous problem.

I'm leanring the URL rewrite rule and have some problems. When I check this link:https://www.iis.net/learn/extensions/url-rewrite module/creating-outbound-rules-for-url-rewrite-module
I find the section 'match filterByTags="A"' . Is it mean that we could pattern the request following the a tag in html?

Can I use the outbound rule to overwrite the hyperlink in html? If it is possible please provide me a demo so that I can try to understand how it works.

Finally. what's the function of rewrite?
Thanks in advance.

IIS Reverse Proxy with ARR 2 and URL Rewrite 2

$
0
0

The environment: IIS, internet facing. Shared Hosting Model, 400 + sites configured under this shared hosting environment.

The internal guy: IBM WepShere 7.5. intranet.

I have implemented the IIS reverse proxy to access web pages on intranet hosted WebSphere. One key thing I noticed is I  got to create the URL Rewrite rule at server/default website level to access pages from a different server.

The problem: My client uses a shared Web hosting environment and on this server there are total 400 sites hosted. So I wanted to make sure that both ARR and the URL Rewrite rule are triggered only for my site and not for other 399 sites. I initially put the the URL Rewrite rule at my site level for this purpose,  but it didn't work and I see that it's failing with in IIS itself. In dev environment I moved it up to Default website level and it still doesn't work for a different reason and  I'm figuring out  how to fix.

My IIS administrators are very adamant to not to create anything that applies to all sites on that shared hosting environment. I tried explaining them that only the URLs matching the pattern in URL Rewrite Rule will be processed thru ARR and URL Rewrite route, but their preference is do something at your site level, but a big no no to default website level.

any suggestions?  Thanks for your help!

Redirect to test.co.uk/name using url rewrite

$
0
0

I am trying to redirect for example sports.test.co.uk to test.co.uk/basketball using URL rewrite

I have configured the A record of sport.test.co.uk to point to test.co.uk. Its currently pointing to the home page but i want it to show the page under test.co.uk/basketball . Can someone please explain how to use the url rewrite to get this done? I'm quite new to it.

How to redirect a url to virtual path?

Reverse proxy and URL rewrite from DMZ

$
0
0

Hello,

From my DMZ server with IIS 7, I need to make available to the Internet a web portal which is hosted on another server. It will be secured by a SSL certificate. So basically, lets say that using addressehttps://site.domain.com should lead to the local network web portalhttp://server:8888/index.html

I found that the best way to do so should be through a reverse proxy with IIS 7 on my DMZ server, with a URL rewrite rule set. I found this post https://weblogs.asp.net/owscott/creating-a-reverse-proxy-with-url-rewrite-for-iis which is almost working for me, but only from the internal, and I get a "mixed content" warning because of the usage of HTTPS going to HTTP site.

I need some advices on that one, cause I'm kind of lost...

Many thanks in advance.

Eric


Install URL Rewrite on Windows 10 Home

$
0
0

Please help.

I have downloaded Microsoft URL Rewrite Module 2.0 for IIS (x64) from the following link.

https://www.microsoft.com/en-us/download/details.aspx?id=47337

I have double clicked the download to install but no URL Rewrite icon appear on IIS version 10

I have followed the install instruction and execute msiexec /I rewrite_2.0_rtw_x64.msi but encountered error below,

"This installation package could not be opened. Verify that the package exists and that you can access it, or contact the application vendor to verify that this is a valid Windows Installer package."

URL Rewrite rule to search URL for specific string and redirect

$
0
0

Hi everyoneI am fairly new to URL Rewrite and i have a problem i really could use some help for. Any help is much appreciated. I have tried to create rules for this, but cannot get it to work. Can i have your take on how to create a rule?

I have been trying to create a rule to redirect users if a certain condition is meet. For example the user could come from:http://testsite.domain.dk

I want to look at the "domain" part of the URL, insert it into a new URL and redirect to for example:http://saasservice.something.domain.something.dk

To play with it lets say that domain = "contoso".
Users come from http://testsite.contoso.dk and should be redirected tohttp://saasservice.something.contoso.something.dk

Can the rule be dynamic and cover more domains? So if a user come from http://testsite.contoso2.dk they get redirected to http://saasservice.something.contoso2.something.dk 

The reason for this is, that i am trying to redirect users based on the SAAS service they request, by looking at the URL they request.

Bet this is pretty simple rule for the experts in here.

Thanks in advance.

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,

Domain Redirect

$
0
0

Good afternoon,

I'm new to the forum, so Hi everyone :)

I need some help with a rule.

So I want redirect sub.domain.com to www.domain.com, but I do not want anything like sub.domain.com/subfolder/ to redirect as I want to map internal urls separately.

Can this be done?

URL rewrite rule about querystring

$
0
0

Hi everyone,
I'm learning how to use rerwite rule to pattern the query string with no solid order but don't understand how to get this.
for example I want to redirect both www.example.com/mysubdomain?name=tom&id=12314 
www.example.com/mysubdomain?id=12314&name=tom to www.example.com/mysubdomain/nametom/id1234.
The name and id's value could be 0-9 or a-z,A-Z.
Any advice will be appreciated.

Viewing all 2482 articles
Browse latest View live


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