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

How to rewrite web request so it has domain.com added?

$
0
0

Hello,

I have IIS 8 on Windows 2012, and some users access websites without a FQDN address.  I need to ensure web requests that are non-FWDN, like http://website/dir/dir/page.aspx, have the domain added, like http://website.domain.com/dir/dir/page.aspx.

I have users with hyperlinks, short-cuts, favorites and the like with addresses like http://website/dir/dir/page.aspx.  They all need to have the domain.com added so the address is FQDN, even when there are paths and pages in the URL.  Can the URL Rewrite Module add the domain.com to these requests, so they look likehttp://website.domain.com/dir/dir/page.aspx?

Thanks,

Paul


Where did Extensibility Samples Go?

$
0
0

I'm attempting to get a production site running locally.
I keep getting a message:

System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Web.Iis.Rewrite.Providers, Version=7.1.761.0, Culture=neutral, PublicKeyToken=0545b0627da60a5f' or one of its dependencies. 

From what I understand on the web, this assembly would have been part of the "extensibility samples" download.
That download doesn't seem to be available anymore.
Does anybody know where I can get a copy of this assembly? (Other than getting access to the production site server and pulling it down)

Thanks!

How do I rewrite the complete URL?

$
0
0

Hey there,

I wish to rewrite the complete URL (no redirect) like this:

https://dev-02/myApplication/

to

https://myApplication/

I've searched alot but couldn't find a way to have the URL Rewrite Module the hostname to a specific one.

Hope you guys can help me,

thanks in advance.

Best regards,

k0alaDEV

Need help with rule to add domain.com to URLs.

$
0
0

Hello,

I am using the URL Rewrite module on a Windows Server 2012 (IIS 8) server. I need to add "domain.com" to URLs that the webserver handles.  URLs coming into IIS are like  http://site/dir/page.aspx, and need them ashttp://site.domain.com/dir/page.aspx. I can get what I have working in my test environment, which is a Windows Sever 2008 R2 server.  However, I can not get this to work on the production environment, which is Windows Server 2012.  This is an inbound rule. Here is what I have:

Request URL:   Matches Pattern

Using:  Regular Expression

Pattern:  .*

Logical Grouping:  Match All

Input:  {HTTP_HOST}   Type:  Matches Pattern:  Pattern:  ^site$

Action Type:  Redirect      Redirect URL:   http://site.domain.com/{R:0}

Append querry string:  checked

Redirect Type:  Permanent (301)

<rules>

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

Can you help me out?

Thanks,

Paul

trailing slash problem with url rewrite

$
0
0

Hi,

I have the below reverse proxy rule setup in IIS 8. 

<rule name="cal" stopProcessing="false">
<match url="^cal/(.*)" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<serverVariables>
<set name="HTTP_ACCEPT_ENCODING" value="0" />
</serverVariables>
<action type="Rewrite" url="https://internalserver/hosted/cal/{R:1}" logRewrittenUrl="false" />
</rule>

When I browse http://publicserver/cal IIS redirects it tohttp://publicserver/cal/ adding the trailing slash and the page gets served fine from the internal server. However when I tryhttp://publicserver/cal/sub-folder the URL on the browser changes tohttp://publicserver/hosted/cal/sub-folder/ and since that doesnt exist I get a 404. I do not have any other rules for adding/removing trailing slashes. However if I browsehttp://publicserver/cal/sub-folder/ with the trailing slash it works fine. 

I have tried Request tracing for Rewrite and that doesnt seem to log the request forhttp://publicserver/cal/sub-folder request. 

Any help in identifying why this behaviour occurs and any possible resolution would be highly appreciated. Thanks. 

IIS ARR high Availbility

$
0
0

Hi

I am planning for IIS reverse proxy high availability by using to IIS ARR with NLB

I have to have two network adapter for each server as it will be used for Lync server 

I am confused about the NLB should I create it in the external network adapter only or the internal network adapter too ?

and is there any recommendation for using NLB for IIS unless the normal installation of NLB and configure ARR accordingly ?

Regards, 

Trying to put double quotes in Contact-Disposition for a particular folder

$
0
0
Aloha from Hawaii

Can someone please assist in providing code that would be able to add double quotes to contact disposition header variable.

I guess I should step back and explain the issue.

We have a .net app that generates report files in xls and PDF formats. The report names are generated with spaces for example Merit Scholarship Report. We are using Firefox as the recommended browser and it cannot handle spaces in the file name. So it sees the contact-disposition as just Merit and can't see the PDF extension that is there. Tested a plug in for Firefox called TruncFix that fixes it but we won't be able to ask our user base to install the plug in.

Here is a link to more info about Firefox and file names with spaces
http://kb.mozillazine.org/Filenames_with_spaces_are_truncated_upon_download

So we are trying to see if for a particular folder where the reports are placed that a rewrite rule can be put in place to placed double quotes in the contact disposition header variable. And assistance will be greatly appreciated.

Mahalo

How to get a rule working on 2 websites?

$
0
0

Hello,

I have a rule working on 1 website on the Windows 2012 IIS webserver. This is good, but when I apply the same rule to another site on the server, the rule does not seem to take affect. It does not run.  I highlight the site in IIS and apply the rule, but the rule does not run.  Is there an issue with getting a rule to run on two sites on the same server?

Thanks. 


Location of URL Rewrite Extensibility Samples

$
0
0

I have found many references to the URL Rewrite Extensibility Samples all the links send me to a retired site. Even what appears to me the official site for URL rewite (http://www.iis.net/downloads/microsoft/url-rewrite) has a link for downloading samples, it sends me to the same retired site. The common link that says it is retired is http://code.msdn.microsoft.com/Project/Download/FileDownload.aspx?ProjectName=rewriteextensibility&DownloadId=9257

I have been unable to find a link that works. Where can I get the URL Rewrite Extensibility Samples?

Darren

Converting Forefront TMG 2010 to URL Rewrite

$
0
0

Hey all - I have been working on this issue for a while now. I am converting our reverse proxy from Forefront TMG 2010 to URL Rewrite. So far I have all of our websites working correctly except for when we try to access Outlook Anywhere. Outlook Anywhere works perfectly through TMG so I was wondering if there was a way to export this rule from TMG and import it into the URL Rewrite module. So far I have recreated all of the rules by hand and since I cannot see where this one is going wrong, thought I would see if an export is possible.

Failure Request Traces show "504 Invalid Query String" and "400 Bad Request". I have followed so many blogs and pages out on the internet that tell me how to create this, but none of them get Outlook Anywhere to work so I am hoping that there is a way to convert this rule to URL Rewrite so I can see exactly what I am missing when trying to convert it. All other features for accessing Outlook from the web (OWA +) are working and they all come through the same URL rewrite rule (Webmail.madden.com/owa and webmail.madden.com/rpc), same as with TMG.

So, is this possible to do?

Cheers

Dave

IIS URL ReWriter Add Provider "Managed Type" dropdown never loads

$
0
0

Hi Friends,

I created a IIS URL rewriter provider, but when I try to add it to urlrewriter module "Managed Type" drowpdown never loads.

Did anybody faced this issue before? did you found any solutio ?

any help much appreciated :-)

Rewrite whitespace

$
0
0

Hi, I'm new here

I have this rule to rewrite:

<rule name="Texts"><match url="^([^_]*)_([^_^]*)\.mid$" /><action type="Rewrite" url="Default.aspx?n={R:1}&amp;t={R:2}" /></rule>

The result of this is

http://localhost/28_Title of the news.mid

How to rewrite this like: http://localhost/28_Title_of_the_news.mid

Thanks for help

Custom URl REwriter From Database not working as expected

$
0
0

Now iam able to get new url from DB using iis Db providers and able to show it but after refresh the new URL ,how this new URl again map to inter nal URL .Kindly advice.

URL Rewrite/ARR and Tomcat. == much frustration and absolutely no joy

$
0
0

Ok.. so it's already driven me grey, and now it's driving be bald.  I just can't seem to get IIS/ARR & URLRewrite to function as a reverse proxy for a Tomcat based application.   I'm guessing it's something relatively simple, but..

Has anyone been able to do this?  If so, could you post a sanitized ruleset showing what you did? (along with any changes you may have made to the TOMCAT code)

What I REALLY need it to do is to be able to acct as the HTTPS termination point and front-end for multiple instances of this particular application.  These instances are/will be on a single host/different ports. 

i.e.:

https://my.domain.com/site-1  <=====>http://TomcatHost.local:1111
https://my.domain.com/site-2  <=====> http://TomcatHost.local:2222
https://my.domain.com/site-3  <=====> http://TomcatHost.local:3333
https://my.domain.com/site-#  <=====> http://TomcatHost.local:####
... [others may follow]

Dilemma with a rule

$
0
0

Hi,

 I'd like to replace underscores with hyphens in some urls, for example:

for this url: /apartment-sale-madrid-1-1.aspx

 I have this rule:

<rule name="rw23">
<match url="^(.*)-(.*)-(.*)-(.*)-(.*)\.aspx"/>
<action type="Rewrite" url="search.aspx?operacion={R:2}&amp;provincia={R:3}&amp;cod_provincia={R:4}&amp;grupo_inmueble={R:5}&amp;ginmu={R:1}"/>
</rule>

The problem is with this url: /country_house-sale-islas_baleares-1-1.aspx

How I can do this url to match the above rule if I replace underscores by hyphens? because I have two words params.

Best regads.


is IIS rewrite the best tool for dynamic virtual subdomains?

$
0
0

peeked your curiosity yet? I've been reading through the forums, and can't seem to find an answer to my question, so here I am.

I inherited a project where users get their own subdomain with a set of 4-5 template php pages with semi-customizable content stored in a mysql database. It supposedly working before it came to me, now it doesn't, so I'm trying to debug the whole thing as I have to duplicate the project for another domain, so I come to you, my gurus, after several hours, nay days, of research, dead-ends, and half-truths from the interweb.

I've been through the IIS URL Rewrite page, looked around here and elsewhere, but I'm just getting confused.

I'm trying to accomplish the following for a growing number of users:

bubba.example.com ===> example.com/users/index.php?c=bubba 
bubba.example.com/about.php ===> example.com/users/about.php?c=bubba 
bubba.example.com/contact.php ===> example.com/users/contact.php?c=bubba

and so on... but I get 404 errors every time, regardless of the username/subdomain name or the template site. Some background info:

- running multiple domains/sites (primarily PHP) from same IP with IIS 7.5, php 5.3 and/or 5.4, and the URL rewrite module
- the default website/direct IP in IIS is pointing to our primary company's site.
- domain's DNS zone file has A records of "*" and "@" pointing to the webserver's IP
- we do have other specified CNAME entries for our own subdomains, like ftp, stmp, pop, admin, etc.
- web.config in this domain's root folder

I've had several versions of this first rule, via web.config and the IIS panel, and this is just the latest version, which I know doesn't work:

<rule name="User Sites" stopProcessing="true">
<match url="(.*)" />
<conditions trackAllCaptures="true">
<add input="{HTTP_HOST}" pattern="^(\w+)\.(example\.com)$" />
<add input="{HTTP_HOST}" pattern="^www\.example\.com$" negate="true" />
</conditions>
<action type="Rewrite" url="http://(C:1)/users/{R:0}?c={C:0}" logRewrittenUrl="true" />
</rule>

My next step was to set up rules for each template page, something like this (might not have the regexes right, but you get the idea:

<rule name="User about page" stopProcessing="true">
<match url="^about\.php$" />
<conditions trackAllCaptures="true">
<add input="{HTTP_HOST}" pattern="^(\w+)\.(example\.com)$" />
<add input="{HTTP_HOST}" pattern="^www\.example\.com$" negate="true" />
</conditions>
<action type="Rewrite" url="http://(C:1)/users/about.php?c={C:0}" logRewrittenUrl="true" />
</rule>

here's my latest rule, but it's still not working...

<rule name="rewrite">
<match url="(.*)?" />
<conditions>
<add input="{HTTP_HOST}" pattern="^(?!www)(.*)\.(.*\.c.*)$" />
</conditions>
<action type="Rewrite" url="http://www.{C:3}/users/{R:0}\?c={C:1}" appendQueryString="true"
</rule>

I realize this one is overkill, as it would not be limited to just the 2 domains I want to rewrite, but I need something functional before I can refine, and this is still not working right.

Some help would be appreciated, even a push in the right direction

http 503 errors: redirect via Execute a URL or Respond with a 302 redirect

$
0
0

Key assumption:  the application pool associated with the web site is stopped.

I've read blog posts/threads stating that with IIS 7 it is simply not possible to respond to a 503 error by redirecting it to an absolute URL.  The reason being that the error process "never gets to a worker process" and comes directly from "http.sys".  For example, see http://stackoverflow.com/questions/2271887/custom-error-page-for-http-error-503.  For my particular tests, I have been able to redirect 404 errors to an absolute URL.

So my question then is, presuming the app pool is stopped, how can you redirect URL requests to the website associated with that app pool to a customized error page.

Thanks, any comments appreciated.

 

Re-Direct Issues

$
0
0

Hi,

I want to re-direct a an URL www.xyz.com/abc?id=1 towww.xyz.com/something by using URL rewrite tool in IIS manager. I have selected "Exact Match" and the pattern is abc?id=1 , action type: redirect, Redirect URL: something , Redirect Type: Permanent (301). Can anyone please help me to what exact pattern do I need to use to redirect this page.

Thanks 

Rewrite to Virtual Application

URL Rewrite via appcmd.exe

$
0
0

I am using the gui to create some general server-level rewrites that work with my application running on 160 websites, but need some site-specific rewrites as well.

I found some sample code to do redirects, below, but nothing for rewrites:

appcmd.exe set config "site name" -section:system.webServer/rewrite/rules /+"[name='http_redirect',enabled='True']" /commit:apphost
appcmd.exe set config "site name" -section:system.webServer/rewrite/rules.[name='http_redirect'] /match.url:"(.*)" /match.ignoreCase:true /commit:apphost
appcmd.exe set config "site name" -section:system.webServer/rewrite/rules.[name='http_redirect'].conditions/add /+"[input='{HTTPS}',pattern='off']" /commit:apphost
appcmd.exe set config "site name" -section:system.webServer/rewrite/rules.[name='http_redirect'].action /+"[type='Redirect',url='https://{HOST_NAME}/{R:1}',redirectType='Found']" /commit:apphost

Can anyone lead me to where I could run such scripts for rewriting, as well as deleting named rules in case a specific rule needs rewriting or removal?

Viewing all 2482 articles
Browse latest View live


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