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

Redirect URL to its subfolder's index file

$
0
0

Dear Friend,

Assume www.sample.com is my domain name. it has a subfolder name "samplefolder". This subfolder has a subfoler name "samplefolder2", this folder contain index.aspx file. i.ewww.sample.com/samplefolder/samplefolder2/index.aspx. If i type the whole URL the pages gets opened.

If i type www.sample.com/samplefolder/samplefolder2/ in address bar it openswww.sample.com/index.aspx only. Instaed of opening the main page i want this to open aswww.sample.com/samplefolder/samplefolder2/index.aspx.

Kindly guide to resolve this issue.


Receiving error "System.Data.SqlClient.SqlException: Procedure or function 'SP_Name' expects parameter '@input', which was not supplied." while using DB Provider

$
0
0

Hi,

I've configured the DB Provider for URL Rewrite using the steps provided in this link:

http://www.iis.net/learn/extensions/url-rewrite-module/using-custom-rewrite-providers-with-url-rewrite-module

However, when I try to redirect to my new URL, I'm getting the following error in the trace logs:

ModuleName RewriteModule
Notification 1
HttpStatus 500
HttpReason URL Rewrite Module Error.
HttpSubStatus 50
ErrorCode 2148735236
ConfigExceptionInfo  
Notification BEGIN_REQUEST 
ErrorDescription System.Data.SqlClient.SqlException: Procedure or function 'SP_Name' expects parameter '@input', which was not supplied.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
   at System.Data.SqlClient.SqlDataReader.get_MetaData()
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteScalar()
   at DbProvider.Rewrite(String value)
   at Microsoft.Web.Iis.Rewrite.RewriteProviderManager.InvokeProviderUnicode(String providerName, String providerInput) 

Here is the entry in web.config:

<rewrite><rules><rule name="DB Rule" stopProcessing="true"><match url="(.*)"/><conditions><add input="{DB:{R:1}}" pattern="(.+)"/></conditions><action type="Redirect" url="{C:1}" redirectType="Found"/></rule></rules><providers><provider name="DB" type="DbProvider, Microsoft.Web.Iis.Rewrite.Providers, Version=7.1.761.0, Culture=neutral, PublicKeyToken=0545b0627da60a5f"><settings><add key="ConnectionString" value="Data Source=Host;Initial Catalog=DB Name;User Id=DB User;Password=Password"/><add key="StoredProcedure" value="SP_Name"/><add key="CacheMinutesInterval" value="2"/></settings></provider></providers></rewrite>

Thanks,

Eric

Rewrite based on text in a page an application to be sent to an end user

$
0
0

Hi,

I have an application that sends back a message to the end user with the following text in the page;

"No logon methods are available on this platform."

The application uses its own authentication method so I cannot redirect a failure to another site via a status code.

So I want to watch for this text being sent back to the end user and intercept it. Instead of sending the page back, I want to redirect the user to another page in the site or another site.

Can this be done?  How?

Thanks in advanced.

Peter

Why is IIS 7.5 URL Rewriter corrupting my image urls

$
0
0

I am having a problem with IIS 7.5 URL Rewriter corrupting my image urls with an extra quote (unmatched) to the end of my image urls on callbacks.

My asp.net web application is .Net Framework 4.0 running on Windows Server 2008 R2, IIS 7.5 with IIS compression. The problem only occurs on pages containing ajax callback controls

On page load/refresh the image url is correct.

The original image is: imageurl="~/Imgs/AI/Cards/medium/widget.png" which is resolved to http://www.mydomain.com/Imgs/AI/Cards/medium/widget.png

My IIS Outbound RewriteRule converts this to point to my CDN:

http://static.mydomain.com/Imgs/AI/Cards/medium/widget.png

On page load / refresh the view source of the image appears as "http://static.mydomain.com/Imgs/AI/Cards/medium/widget.png"

When a callback is triggered, the image url in the html view source has an extra " and appears as:      "http://static.mydomain.com/Imgs/AI/Cards/medium/widget.png""
or "http://static.mydomain.com/Imgs/AI/Cards/medium/widget.png&quot;"

This is a bad url and no image is shown. If I turn off the rewriter rule the problem goes away, but so does my ability to serve the images from my static image CDN site.

Many thanks in advance for your assistance.

The following is the rule that is resulting in the corrupted image urls

<rewrite><outboundRules><rule name="Remove ETag"><match serverVariable="RESPONSE_ETag" pattern=".+" /><action type="Rewrite" value="" /></rule><rule name="CDNRewriteStaticImages" preCondition="html" enabled="true" patternSyntax="Wildcard" stopProcessing="false"><match filterByTags="Img" pattern="*/Imgs/*" ignoreCase="true" /><action type="Rewrite" value="//static.mydomain.com/Imgs/{R:2}" /><conditions logicalGrouping="MatchAny"><add input="{URL}" pattern="*//static.mydomain.com/*" negate="true" /><add input="{URL}" pattern="\.axd$" negate="true" /><add input="{URL}" pattern="\.svc" negate="true" /></conditions></rule><preConditions><preCondition name="html"><add input="{RESPONSE_CONTENT_TYPE}" pattern="text/html" /></preCondition></preConditions></outboundRules>

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.

Rewrite Pattern Check works but does not rewrite from browser

$
0
0

Hi, i have written an URL rewrite rule, it works when i test the pattern through the IIS manager, however after saving my config the exact same url doesn't seem to match, no action is taken (HTTP 200). Other redirects are working correctly.

I want to achieve:

URL:

https://test/test/test/_layouts/control.aspx/?__id=webDiagram.show&map=0%3A5FC1780E344141F6A9C8055F92CA40F7&dgm=4DB0DFB26608409B9774DF1778303DF0&one=14

Needs to be rewritten (redirected) to:

https://otherurl/CtrlWebIsapi.dll/?__id=webDiagram.show&map=__id=webDiagram.show&map=0%3A5FC1780E344141F6A9C8055F92CA40F7&dgm=4DB0DFB26608409B9774DF1778303DF0&one=14

I try this through the following URL Rewrite with which it seems to match the pattern.

<rule name="TEST Documents Rewrite" enabled="true" stopProcessing="true"><match url="https://test/test/test/_layouts/control\.aspx/\?__id=webDiagram\.show\&amp;map=(.*)" /><action type="Redirect" url="https://otherurl/CtrlWebIsapi.dll/?__id=webDiagram.show&amp;map={R:1}" appendQueryString="false" /></rule>

Why is the pattern matching in the manager but does not from the browser?

Rewriting URL due to iis application name change?

$
0
0

We recently re-branded an IIS application and changed the application name from "application1" to app2, under the default website

What I want to do is rewrite or redirect all users like so;

www.domainname.com/application1  => www.domainname.com/app2
www.domainname.com/application1/* => www.domainname.com/app2/*

How do I do this and do I do it on the default website where the application is sat or on the application itself?

Many thanks

Simon

WebSocket IIS7 Reverse Proxy - 502.3 Bad Gateway

$
0
0

I have a 3rd party WebSocket server (Fleck) running on port 8182 on IIS 7 (ARR 3.0 installed) e.g. ws://example.com:8182

Clients can connect to this just fine if I add a inbound rule to the firewall but I would rather expose this over port 80 via my public site (and avoid any issues with intermediaries).

So I want to expose the endpoint ws://example.com/ws and have this rewritten to ws://example.com:8182 on the webserver.

I have managed to get a similar behaviour working for http:// exposing an internal site hosted on a different port following various articles from Scott Forsyth and have maintained the protocol by following this article.

Unfortunately, as soon as I change over to ws:// I get a 502.3 Bad Gateway response.

Here's what I have in the public site Web.config

<rule name="Reverse Proxy to Fleck on 8182" stopProcessing="true"><match url="(.*)ws" /><conditions trackAllCaptures="false"><add input="{CACHE_URL}" pattern="^(.+)://" /></conditions><action type="Rewrite" url="{C:1}://example.com:8182" /></rule>

Whereas if I use this setup for requesting a page via http:// on an internal site it works, e.g.

<rule name="Reverse Proxy to 8990" stopProcessing="true"><match url="(.*)ws" /><conditions trackAllCaptures="false"><add input="{CACHE_URL}" pattern="^(.+)://" /></conditions><action type="Rewrite" url="{C:1}://example.com:8990/index.aspx" /></rule>

Any help appreciated.


2 domains with one Joomla install

$
0
0

Hello, 

To keep things simple for my content creators I have created a Joomla site that has 2 different themes and it is all setup to look different. I This is an internal server so I am stuck at this point. I would normally just put in a stealth redirect of the domain but I don't think that is going to work in my case. 

I am running server 2012. 

I have www.domain1.com

and the second site is on www.domain1.com/bhome

I would like www.domain2.com look mask www.domain1.com/bhome and make it look totally different to the end user.  

I have tried all the options on this site which is what I thought would be the finish link. http://docs.joomla.org/Multiple_Domains_and_Web_Sites_in_a_single_Joomla!_installation

but I have not had any luck.

Right now I have just edited my host file while I set things up. 

Any help would be much appreciated. 

thanks, 

Specified config Source cannot be parsed

$
0
0

Hi,

I'm getting Specified configSource cannot be parsed while trying to try rewrite Maps

In web.config I place,

<rewrite>
<rewriteMaps configSource="rewritemaps.config" />
<rules>
<rule name="Rewrite Rule">
<match url=".*" />
<conditions>
<add input="{StaticRewrites:{REQUEST_URI}}" pattern="(.+)" />
</conditions>
<action type="Rewrite" url="{C:1}" />
</rule>
</rules>
</rewrite>

and in root file of my published code I placed "rewritemaps.config" and write the following,

<?xml version="1.0"?>

<configuration>


<rewriteMaps>
<rewriteMap name="StaticRewrites">
<add key="/University1" value="KISDashBoardDetails.aspx?Uni=University1" />
<add key="/University12" value="KISDashBoardDetails.aspx?Uni=University2" />
</rewriteMap>
</rewriteMaps>
</configuration>

when I'm placing the above code in web.config its working fine. But when I'm trying to place the code in another file, I'm getting error 

Any suggestions??????????

Lync 2013 Reverse Proxy

$
0
0

I have used the following for installing and configuring Reverse Proxy for Lync 2013 using ARR 3.0 with Windows Server 2012R2 

http://blogs.technet.com/b/nexthop/archive/2013/02/19/using-iis-arr-as-a-reverse-proxy-for-lync-server-2013.aspx

DNS Entries for Meet, Dialin, Lyncdiscover, LyncExt are created with Public IP and they are Natted to the External Interface IP of the Reverse Proxy Server.

Now all the rules are setup properly, but I have some questions regarding the steps performed:

1. DNS Entries for Meet, Dialin, Lyncdiscover, LyncExt should be resolved to what exactly. Should it be the FrontEnd Server Internal IP Address 

2.  When creating the server farm, I used meet.schs.sharjah.ae as the server farm name and used lyncs.schs.sharjah.ae (Front End Server Pool) as the server address. Then changed the advanced setting of port 443 to 4443 and port 80 to 8080. Is this the right way to go about it.

3. Finally when URL rewrite rules are created, the article says to delete the HTTP rules and keep only HTTPS. However when I go to any of the server farms and click on routing rules, it informs me that 'Routing rules have not been created for this server farm' checking the checkbox will recreate HTTP rules and deleting the HTTP rules unchecks the checkbox. Is this supposed to happen

4. Each of the URL rewrite rules has a condition set as {HTTP_POST} and its here the patter is set. But in the edit page under the Match URL the pattern is a * Is this correct or should the patter here be similar to the one in the condition for example meet.*

Now if I browse a https page for instance https://meet.schs.sharjah.ae, I get (502 - Web server received an invalid response while acting as a gateway or proxy server.) But If I try to browse it with http, that is http://meet.schs.sharjah.ae, I get the Default Website IIS Page. No matter whatever server farm I try it goes to the same IIS Page and not to the proper Lync Page on the Front End Server.

I have no clue as to why its not getting route to the proper location. Would love to get some help in the area as I'm relatively new to IIS ARR

URL Rewrite Rule not working for another site

$
0
0

Hello,

I have one URL Rewrite rule working fine on one site that is using port 80.

On the same IIS server, there is another site with port 3228, but the same rule is not taking affect.

Maybe ports need to be opened or some security setting for non-port 80 sites?

Can you tell me what could be preventing the rule from running?

<rules>

<rule name="site" patternSyntax="Wildcard" stopProcessing="true">
<match url="*" />
<conditions>
<add input="{HTTP_HOST}" pattern="hermes" />
</conditions>
<action type="Redirect" url="http://site.doman.com/{R:0}" />
</rule>
</rules>
</rewrite>

Using url rewrite to insert a subsite at the root of a website

$
0
0

Hello

Ive been trying very unsuccessfully to use url rewrite to attempt to achieve the following:

- I have our primary website http://www.mycompany.com/ that has a number of subfolders and content

- We have now been required to publish a website from another internal server through our main webserver as an application sohttp://www.mycompany.com/thirdpartyapp/ which is working for some of the content but we are finding some links are not working as they are referencing the base website instead of where they are (So its looking for http://www.mycompany.com/themes/logo.jpg instead ofhttp://www.mycompany.com/thirdpartyapp/themes/logo.jpg)

So I guess I have two questions here, would url rewrite be useful for things like .jpg links and the like inside webpages, and is it possible to use url rewrite to somehow achieve what im after with only a single rule or would it be one rule for each subfolder of the thirdpartyapp or not even possible at all ?

Thanks

Reverse proxy keeps removing applicatoin folder directory from URL

$
0
0

I'm trying to resolve cross-domain issues between IIS, and Geoserver. I use port 8085 for IIS and 8080 for Geoserver.

When I create a reverse proxy rule in the root folder, either xxx.com or sub.xxx.com, it works perfectly, except that I then can't host a website in that domain in IIS. Instead, I add an application to the website in IIS named "geo" and give it a physical path to an empty folder. I then create a reverse proxy rule where the rewrite url is:

Pattern: (.*)

Rewrite URL: http://127.0.0.1:8080/{R:1}

 When I go to xxx.com/geo, it loads properly. When I go to any further subdirectory that is hosted by geoserver such as xxx.com/geo/geoserver, it removes the "geo" and attempts to load xxx.com/geoserver, which doesn't exist and gives an error.

Any ideas on what I'm doing wrong?

rewrite *asp* to *aspx*

$
0
0

Having upgraded our webs from iis 6 and asp to iis8 and aspx many of our clients are getting 404 not found errors with their saved bookmarks.  We would like to use the url rewrite module to rewrite/redirect *asp* to *aspx*.  This is what we've come up with:

<rewrite>
            <rules>
                <rule name="test" stopProcessing="true">
                    <match url="(.*)asp(.*)" />
                    <action type="Rewrite" url="{R:1}aspx{R:2}" />
                    <conditions>
                        <add input="{QUERY_STRING}" pattern="(.*)aspx(.*)" negate="true" />
                    </conditions>
                </rule>
            </rules>
        </rewrite>

 

Could anyone tell me what I am doing wrong?  Thank you in advance.

 


Url Rewrite

RPC not passing through ARR

$
0
0

Hi, I have Server 2012 with ARR 3.0. On ARR I have one public certificate installed (UCC) and behind ARR I have several sites to include terminating server for SSTP. Since I am not able to use SSTP when I go through ARR I saw in FailedRequestTracing that rpc is giving error 404.13 (https://remote.domain.com/rpc/rpcproxy.dll?Servername.domain.local:6001) But if I enter this in remote client web browser I can connect with username and password.

Did anyone tried to configure ARR to pass through SSTP requests?

How to block unwanted redirect from a domain to my site?

$
0
0

I need to block redirect from a other domain to my site, how to do this using URL Rewrite module?

I am using IIS 7.5

Thank you.

application pool crash when I use ISS ARR to rewrite urls

$
0
0

Hi Dev,

I met the application pool crash when I use ISS ARR to rewrite urls.

I don't understand why exceptions were crashed not regularly.

Do you know why?

It is a very urgent problem.Could you help me? Please reference below crash stack to know more detail.

 *******************************************************************************

 Analysis Summary    Type Description Recommendation   Error WARNING - DebugDiag was not able to locate debug symbols for rewrite.dll, so the

information below may be incomplete.

 

In

w3wp__0__PID__61048__Date__07_18_2014__Time_02_29_57PM__330__Second_Chance_Exception_C0

000005.dmp the assembly instruction at rewrite!RegisterModule+304fa in C:\Windows\System32\inetsrv

\rewrite.dll has caused an access violation exception (0xC0000005) when trying to read from memory

location 0xe40b4270 on thread 43  Please follow up with the vendor for C:\Windows\System32\inetsrv\rewrite.dll     Information DebugDiag determined that this dump file

(w3wp__0__PID__61048__Date__07_18_2014__Time_02_29_57PM__330__Second_Chance_Exception_C

0000005.dmp) is a crash dump and did not perform any hang analysis. If you wish to enable combined

crash and hang analysis for crash dumps, edit the Globals.asp script (located in the DebugDiag

\Scripts\inc folder) and set the g_DoCombinedAnalysis constant to True.      

   Analysis Details 

   Your browser settings are currently prohibiting this report's scripts from running.

This is preventing some features of this analysis report from displaying properly. To enable

scripts to run, right-click the security warning above and choose "Allow Blocked Content..." or

enable the "Allow active content to run in files on My Computer*" setting on the Advanced tab of

your "Internet Options" dialog to avoid being prompted in the future 

 

 

 

Table Of Contents w3wp__0__PID__61048__Date__07_18_2014__Time_02_29_57PM__330__Second_Chance_Exception_C0

000005.dmp

   Faulting Thread

   Faulting Module Information

   .NET Analysis Report

 

 Report for

w3wp__0__PID__61048__Date__07_18_2014__Time_02_29_57PM__330__Second_Chance_Exception_C0

000005.dmp

 

 Report for

w3wp__0__PID__61048__Date__07_18_2014__Time_02_29_57PM__330__Second_Chance_Exception_C0

000005.dmp Type of Analysis Performed   Crash Analysis Machine Name   WIN-95PVLMLK8Q1 Operating System   Windows Server 2008 R2 Service Pack 1 Number Of Processors   8 Process ID   61048 Process Image   c:\Windows\System32\inetsrv\w3wp.exe System Up-Time   50 day(s) 17:23:20 Process Up-Time   12:00:00

Thread 43 - System ID 63320 Entry point   w3tp!THREAD_MANAGER::ThreadManagerThread Create time   2014/7/18 6:08:03 Time spent in user mode   0 Days 0:6:58.628 Time spent in kernel mode   0 Days 0:0:29.234

 

 

 

.NET Call Stack

 

Function

Full Call Stack

 

Function     Arg 1     Arg 2     Arg 3     Arg 4   Source rewrite!RegisterModule+304fa     00000000`105dbc00     00000000`0000000a     00000000`00000001    

00000000`774e1a4a    rewrite!RegisterModule+2fc64     00000000`07f8ec78     00000000`07f8d898     00000000`0250dbd8    

000007fe`e4055d10    rewrite!RegisterModule+13582     00000000`07f8ec78     00000000`07f8d8a9     00000000`00000000    

00000000`00000000    rewrite!RegisterModule+12f62     00000000`0000000a     00000000`00000000     00000000`07f8d970    

00000000`07f8d974    rewrite!RegisterModule+f020     00000000`022a6530     00000000`022a6530     00000000`07f8ed40    

00000000`07f8f218    rewrite!RegisterModule+1429     00000000`022a70f0     00000000`00000000     00000000`00000000    

00000000`00000000    rewrite!RegisterModule+57c     00000000`085b50c8     00000000`00000000     00000000`00cb9128    

00000000`00000000    iiscore!NOTIFICATION_CONTEXT::RequestDoWork+100     00000000`022a70f8     000007fe`f50e242d    

000007fe`e42e5ba8     00000005`0000fffe    iiscore!NOTIFICATION_CONTEXT::CallModulesInternal+174     00000000`e42e5ba8     00000000`022a70f0  

  00000000`022a70f8     00000000`00000000    iiscore!NOTIFICATION_CONTEXT::CallModules+25     00000000`07f80000     00000000`022a70f0    

00000000`00000000     00000000`022a70f8    iiscore!W3_CONTEXT::DoWork+18f     00000000`022a70f0     00000000`022a6530     00000000`022a70f0   

 00000000`00000000    iiscore!W3_MAIN_CONTEXT::OnNewRequest+1c3     00000000`00000000     00000000`022a64d0    

00000000`00000000     00000000`00bdc090    w3dt!UL_NATIVE_REQUEST::DoWork+126     00000000`00bdc090     00000000`00000000    

000007fe`f52b0000     00000000`00000000    w3dt!OverlappedCompletionRoutine+1c     00000000`00bdc090     00000000`00000000    

00000000`00000000     00000000`00000000    w3tp!THREAD_POOL_DATA::ThreadPoolThread+7a     00000000`000004bb     00000000`022a64d8    

000007fe`e42a1080     00000000`00000000    w3tp!THREAD_POOL_DATA::ThreadPoolThread+34     00000000`00bdc120     00000000`00d2d350    

00000000`00d2d350     000007fe`f52b0000    w3tp!THREAD_MANAGER::ThreadManagerThread+61     00000000`00000000     00000000`00000000    

00000000`00000000     00000000`00000000    kernel32!BaseThreadInitThunk+d     00000000`00000000     00000000`00000000     00000000`00000000   

 00000000`00000000    ntdll!RtlUserThreadStart+1d     00000000`00000000     00000000`00000000     00000000`00000000    

00000000`00000000   

 

 

 

 

Exception Information REWRITE!REGISTERMODULE+304FAWARNING - DebugDiag was not able to locate debug symbols for

rewrite.dll, so the information below may be incomplete.

 

In __PID__61048__Date__07_18_2014__Time_02_29_57PM__330__Second_Chance_Exception_C0000005.dmp the

assembly instruction at rewrite!RegisterModule+304fa in C:\Windows\System32\inetsrv\rewrite.dll has

caused an access violation exception (0xC0000005) when trying to read from memory location

0xe40b4270 on thread 43

 

 

Module Information Image Name: C:\Windows\System32\inetsrv\rewrite.dll   Symbol Type:  Export Base address: 0x00000003`00905a4d   Time Stamp:  Thu Jun 24 07:12:06 2010  Checksum: 0x00000000`00000000   Comments:   COM DLL: False   Company Name:   ISAPIExtension: False   File Description:   ISAPIFilter: False   File Version:   Managed DLL: False   Internal Name:   VB DLL: False   Legal Copyright:   Loaded Image Name:  rewrite.dll   Legal Trademarks:   Mapped Image Name:     Original filename:   Module name:  rewrite   Private Build:   Single Threaded:  False   Product Name:   Module Size:  392.00 KBytes   Product Version:   Symbol File Name:  rewrite.dll   Special Build:  &

     

Create redirection - Microsoft URL Rewrite

Viewing all 2482 articles
Browse latest View live


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