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

Url rewrite for single binding of a website in IIS7

$
0
0

Hi Guys,

In my IIS I added a website with different bindings like below on default port:

test1.medical.com

test2.medical.com

test3.medical.com

test1.medical.com is an .net application converted to php application as test1.com

Now I need to redirect "test1.medical.com" to "test.com" and their corresponding inner pages as below:

test1.medical.com/default.aspx to test1.com/home

test1.medical.com/news.aspx to test1.com/news

test1.medical.com/games.aspx to test1.com/gameshome

If i set url rewrite for test1.medical.com/default.aspx to test1.com/home it is also applies to rest of the 2 sites(test2.medical.com/default.aspx,test2.medical.com/default.aspx).

I need to apply only for first site. Can any one tell me how to resolve this issue.

Thanks,

Pavan Kumar.


Rewrite Rule to redirect frm domain other than one page

$
0
0

I am new to Rewrite module . Any quick reply will be helpfull

I need to write rule for following condition and want to maintain protocol as it is.  

1) B.mydomain.com/one.html - dont do anything

2) B.mydomain.com/otherthanone.html (anything other than one.html), redirect to X.mydomain.com

i m also new to "logicalGrouping" if it will use to apply "AND" relationship between condition or not.

I tired following but it is not working to avoid one.html, it redirect all request of  B.mydomain.com to X.mydomain.com


<rule name="RedirectBRule" enabled="true" stopProcessing="true">
<match url="(.*)" />

<conditions logicalGrouping="MatchAll">
<add input="{HTTP_HOST}" pattern="^B\.mydomain\.com$" />
<add input="{REQUEST_URI}" negate="true" pattern="^(b.mydomain.com/one.html)$" />
</conditions>
<action type="Redirect" url="{MapProtocol:{HTTPS}}://X.mydomain.com/" logRewrittenUrl="true" appendQueryString="false" redirectType="Permanent" />
</rule>
<rewriteMap name="MapProtocol">
<add key="on" value="https" />
<add key="off" value="http" />
</rewriteMap>

Rewrite with optional variables

$
0
0

Hello,

I have specific question, which seems easy to answear, but I didn´t find any hints here or in any other forums about IIS.

Let´s have a rule for URL rewrite

1.) Simple page like /search.asp?what=ratings which i can rewrite to /search/ratings/ with rule (^search/([^/]+)/?$) and (search.asp?what={R:1}). Works fine

2.) Then the same will work with other variables like /search.asp?what=ratings&where=detroit which i can also rewrite to (/search/ratings/detroit/) with similliar rule. Works fine.

3.) But then things are going to complicate. The same page features other things like(/search.asp?what=ratings&from=workers) which when i make simillar rule like 2.) it will work only in url (search/ratings/workers) but it seems app cannot process the query, because variable (from=workers) was not passed. Rule 2.) process only with variable (where=detroit) but not (from=workers) and rule 3.) s skipped.

When I am trying to build complicated rule like (search.asp?what={R:1}&where={R:2}&from={R:3}) it doesn´t work with empty variables and when I make some nonsense variables (search.asp?what=ratings&where=detroit&from=none) it will of course make url like (search/ratings/detroit/none) which is horrible.

So my question is:

Is there a way how to make a one rule which will work for more query strings and variables at once, but it is optional/not necessary to have these query strings and variables always present?

Thanks!

T.

IIS8 url rewriting not working

$
0
0

Hi,

I'm trying to rewrite a url via iis url rewrite which redirects https://www.domain.com/all_job_list.php?category=1 to https://www.domain.com/all-job-list/Accounting-bookkeeping

It simply show the same source again with the site loading under https://www.domain.com/all_job_list.php?category=1

I have added the following rule.

-

    <rule name="generated-0" stopProcessing="true">
  <match url=".*" />
    <conditions logicalGrouping="MatchAny">
      <add input="{URL}" pattern="https://www.domain.com/all_job_list.php?category=1$" />
    </conditions>
    <action type="Redirect" appendQueryString="false" url="https://www.domain.com/all-job-list/Accounting-bookkeeping/" redirectType="Permanent" />
</rule>

--

I even tried even a  basic rule and that too is not working. The url rewrite i installed is this one "http://www.iis.net/downloads/microsoft/url-rewrite". Even tried uninstalling and reinstalling the module.

Could some one point me what is the issue here?

Is there anything different to be done in iis8(win 2012 ) servers?

Thanks,

Jaffer

How to create a redirect through the "RewriteEngine On"

Need to write 2 rewrite rule in IIS for 2 different applications deployed in same tomcat server

IIS 8.5 ARR Reverse Proxying block some contents

$
0
0


Dear all,

I've been trying to setup the usual reverse proxy scenario with IIS 8.5, ARR 3.0 and URL Rewrite 2.0:

site.public.com resolving into the IIS ARR server

site.public.com/App1 redirecting into an internal backend web server app1.internal.com
site.public.com/App2 redirecting into an internal backend web server app2.internal.com


I've followed great tutorials here and here and there, got something almost working, but some contents is not correctly rewritten, resulting in a web page being partially displayed for App1 and a basic authentication loop/failure for App2.

The config I'm using for inbound rules is:

<rule name="Reverse Proxy to app1" stopProcessing="true"><match url="^app1/(.*)" /><action type="Rewrite" url="https://app1.internal.com/{R:1}" logRewrittenUrl="true" /><serverVariables><set name="ORIGINAL_HOST" value="{HTTP_HOST}" /></serverVariables></rule><rule name="Reverse Proxy to app2" stopProcessing="true"><match url="^app2/(.*)" /><action type="Rewrite" url="https://app2.internal.com/{R:1}" logRewrittenUrl="true" /><serverVariables><set name="ORIGINAL_HOST" value="{HTTP_HOST}" /></serverVariables></rule>

Inbound rules seems to be fine.

Outbound are mostly causing my troubles. As for outbound rules, I did try a few alternatives, following the tutorials mentioned above, none of them worked as expected.

The only way I could get at least one of the website to be available, was by using for either of them:

<outboundRules><rule name="Response Status Update" preCondition="IsHTML" stopProcessing="true"><match serverVariable="RESPONSE_Location" pattern="^/(.*)" /><action type="Rewrite" value="https://public.site.com/app1/{R:1}" /></rule>  <preConditions> <preCondition name="IsHTML"><add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" /></preCondition><preCondition name="IsRedirection"><add input="{RESPONSE_STATUS}" pattern="3\d\d" /></preCondition></preConditions> </outboundRules>

With other rules, I was having redirect issue, and the website wouldn't' even be loaded. Now with the basic outbound rule above, it is loading, but only display a part of the website content.  The rule is not applied to Javascripts for example. Jquery come back in public.site.com/assets/... 404 error, instead of public.site.com/app1/assets/...

I did spend time configuring a RP with Apache, which was working rather well but also limiting some javascripts. I tried with ARR as an alternative, but again encounter some difficulties.

Can someone tell me if this is feasible, or if I should simply forget about it and go for the usual Port Forwarding or good old TMG :) ? 

Thanks in advance for any help you might provide.

Hide CFM file extensions and keep wordpress working.

$
0
0

Hi All

I'm trying to modify my web.config file so that the URL rewrite will make "company.cfm" to "company" (removing the cfm part) but still work with the rules for wordpress.

For the CFM - An example url might be http://wwww.xyz.com/company/abc-ltd/

This is what I have tried.

<rule name="wordpress" patternSyntax="Wildcard"><match url="*" /><conditions><add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /><add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /></conditions><action type="Rewrite" url="index.php" /></rule><rule name="company cfm"><!--Removes the .cfm extension for company.cfm --><match url="(.*)/company/(.*)" /><conditions logicalGrouping="MatchAll"><add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /><add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /></conditions><action type="Rewrite" url="{R:1}.cfm" /></rule>


Domain setup on IIS with a folder on different server

$
0
0

Hi

I need urgent help regarding this issue

I have 2 servers. On one of the two servers (A) I have placed content of the domain. The SQL-Sever is also installed on the same

On 2nd server (B) Ive created a domain which is mapped to folder on A using UNC path. With this setup, normal urls are working fine 

eg

http://domain.com/welcome.html or http://domain.com/welcome.asp or http://domain.com/welcome.php

but the urls rewritten with helicon component are not working

eg I have rewritten a url http://domain.com/about.asp as http://domain.com/about

It seems to be due to permission issue

I tried to import the rules from .htaccess to iis but it gives many errors. Also the syntax on IIS ISAPI rewrite is different from that used with helicon. It will be a big exercise for us to migrate the rules. 

Is there any other solution?

Rewrite Header is not working when redirecting to a diffent application

$
0
0

Hi,

I am trying to configure Single Sign On from IIS to a WebSphere Application. in IIS I have set URL Rewriting rules and redirected the rewritten header values to a remote websphere application . but a particular header value(SSOUSER) is going as empty from IIS . I am using Helicon Rewriter.

Please help me.

 

 

I have added this code in C:\Program Files\Helicon\ISAPI_Rewrite3\httpd.conf

 

# Helicon ISAPI_Rewrite configuration file

# Version 3.1.0.104

RewriteEngine on

RewriteCond %{REMOTE_USER} (.*)\\(.*)

RewriteHeader SSOUSER: .* (%1)(_)(%2)

RewriteHeader Authorization: .* ()

 

 

 

I have put a custom jsp in the remote Websphere Applicaiton to check the header values but I can view the SSOUSER value but when I am redirecting I could not get the value. please help me it is very urgent,.

Reverse Proxy + URL Rewrite

$
0
0

Hello all,

First time I'm trying to use Reverse Proxy (ARR) and URL Rewrite and I'm hoping I could get a little bit of help (if this is the wrong location, please let me know and I'll move it)


Either way, we have 1 static IP, a hosted site, and a number of internal services we now want to make public. I know how to do this using port forwarding but we want to move those to subdomains and route everything through our DMZ.

Here is what I'm trying to set up. Static IP ->Natted from the ASA to the External interface of the DMZ server (it is a VMWare server) I have IIS installed there. All of our A records from our web host point to this natted IP (mail.domain.pw -> x.x.x.x, vpn.domain.pw -> x.x.x.x, etc)

All of our services are on different internal servers so, what I'm hoping for is this:

External user goes to mail.domain.pw -> request is sent through the ASA and arrives at external interface of DMZ server (dmz.domain.local). IIS somehow handles this request, sees that the request is looking for mail.domain.pw and sends the request to mail.domain.local through it's internal interface. The request then goes through some outbound rules, I imagine, and they are then able to connect to mail at mail.domain.local.

I'm not sure what the process for creating sites in IIS is since IIS won't actually 'host' the sites? and since it's not domain.local but domain.pw that the requests are looking for?

Any help would be SUPER appreciated!

Thanks

PLS fix my rule for redirect pages

$
0
0

Hi everyone

I updated my website, now I need make a redirect rule to keep old link working.

old link : http://mysite.com/view.asp?id=1

Page now: http://mysite.com/post/1.htm

I wrote one rule but id doesn't work:

<rule name="OldPost" stopProcessing="true"><match url="^view.asp\?id=([0-9]+)$" /><action type="Redirect" url="post/{R:1}.htm" /></rule>



Help PLS!

Url rewrite help

Url rewrite in asp.net c#

$
0
0

please any help on how to do url like subdomains.

example if there is like www.domain.com/username=test it will become like test.domain.com 

please any help urgently ( please a code example also) 

Url Rewrite Help 301 Redirect

$
0
0

Trying to redirect  this url https://www.freertool.com/products/modularweldingtables/ tohttp://modularweldingtables.com and it isnt working.  This is in IIS 7.5 and i have done a iisreset as well.

<rules><clear /><rule name="modularwelding" stopProcessing="true"><match url=".*" /><conditions><add input="{HTTP_HOST}" pattern="https://www.freertool.com/products/modularweldingtables/" /></conditions><action type="Redirect" url="http://modularweldingtables.com" /></rule><rule name="HTTPS" stopProcessing="true"><match url="(.*)" /><conditions logicalGrouping="MatchAll" trackAllCaptures="false"><add input="{HTTPS}" pattern="^OFF$" /></conditions><action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="SeeOther" /></rule></rules>

What am I missing ?


I need help with this isssue.

$
0
0
<div class="content-container">

HTTP Error 404.0 - Not Found

The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

</div> <div class="content-container">
Detailed Error Information<div id="details-left">
ModuleIIS Web Core
NotificationMapRequestHandler
HandlerASPClassic
Error Code0x80070002
</div> <div id="details-right">
Requested URLhttp://localhost:80/test.asp
Physical PathC:\inetpub\wwwroot\test.asp
Logon MethodAnonymous
Logon UserAnonymous
<div class="clear"></div> </div>
</div> <div class="content-container">
Most likely causes:
  • The directory or file specified does not exist on the Web server.
  • The URL contains a typographical error.
  • A custom filter or module, such as URLScan, restricts access to the file.
</div> <div class="content-container">
Things you can try:
  • Create the content on the Web server.
  • Review the browser URL.
  • Create a tracing rule to track failed requests for this HTTP status code and see which module is calling SetStatus. For more information about creating a tracing rule for failed requests, click here.
</div>

URL rewrite not working(iis8)

Rules at "Web App Level" Don't Run

$
0
0

If I create a rule at the "web app level" it doesn't work. If I take that exact same rule and put it at the "top-level" it runs fine. Any ideas on why this would be happening? Just to be more clear:

If I put them at the "Web App level" they don't work:

Why don't rules run at the web app level? Am I doing something wrong or is this by design? If it's by design then why have "Local" entry types? It seems to me if they allow you to enter rules that are "local" to "web app" it should be possible...but they don't run. Why?

Any insight as to why would be *greatly* appreciated.

WordPress with BuddyPress - Images wont load after URL Rewrite

I cannot get 301 Redirects to work in URL Rewrite Module IIS7

$
0
0

I followed the instructions on two different pages (listed below) and I simply cannot get any 301 redirect to work on Windows 2008 R2 (x86) with IIS 7.   I've updated the Rewrite Module 2.0. I've tried both the user interface in the IIS Manager dashboard and I've tried directly editing the web.config file.  I am using WordPress and the rewrite modules works for the permalinks and also redirects 404 errors to a specific page.  So I know URL rewrite is working but I cannot get 301 redirects to work at all.

Is there some other prerequisite? I read up on the HTTP Redirects and installed that in IIS but that seems to provide only one rule which it seems to me would redirect everything to one location.  I am not sure if it is prerequisite for URL Rewrite 301 Redirects or how it should be configured.  

I initially wanted to have an external rewrite map because I have about 50 URL's to redirect to new pages on the same sitt. But I started out with just 2 to test it out. And I was wondering where does the external file (e.g. StaticRedirects.config) go? I assume in the same root directory as web.config lives. 

But I scratched the external file and placed my rewrite map in the web.config file just to get it working in the first place and that I cannot do.  There is SOMETHING I am missing.  So the instructions on the following link regarding multiple 301 Redirects does not work for me whether I have the redirect parameters in web.config or externally.

http://www.orcsweb.com/blog/peter/how-to-create-multiple-301-redirects-url-rewrite-map/

http://www.iis.net/learn/extensions/url-rewrite-module/using-rewrite-maps-in-url-rewrite-module

What am I missing?
Thank you

Viewing all 2482 articles
Browse latest View live


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