url-rewrite-module

IIS URL Rewrite: Add trailing slash except for .html and .aspx

ⅰ亾dé卋堺 提交于 2019-12-03 09:35:57
问题 Adding a trailing slash to all URLs through IIS URL Rewrite Module is widely spread, but how do I add exceptions for URLs that ends with .html and .aspx ? Today I have this: <rule name="Add trailing slash" stopProcessing="true"> <match url="(.*[^/])$" /> <conditions> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> <!-- Doesn't seem to be working --> <!--<add input="{REQUEST_URI}" pattern="(.*?).html$"

Put images on CDN, using MVC3 on IIS7

ε祈祈猫儿з 提交于 2019-12-03 07:44:12
问题 I need to use CDN for all images on my site. So, Ive decided to use IIS Url-rewriting module, because edit manually all my site views - its impossible for me. So Ive made rules for IIS, eg: <rule name="cdn1" stopProcessing="true"> <match url="^Content/Images.*/(.*\.(png|jpeg|jpg|gif))$" /> <action type="Redirect" url="http://c200001.r9.cf1.rackcdn.com/{ToLower:{R:1}}" redirectType="Permanent" /> </rule> Its worked, but as you can see there is redirect type is used (301 Permanent). And I think

IIS Rewrite Module and sub applications

╄→гoц情女王★ 提交于 2019-12-03 03:45:43
Here's what I have deployed: testRedirect is an empty website. All sub-applications are sub-folders that have been converted in application. All of them are ASP .Net MVC sites. Here's what I want to setup: Http://localhost/ must show the content of SiteName1 without displaying Http://localhost/SiteName1/ in the adress bar (it must stay Http://localhost/ ) Http://localhost/SiteName1/ must show the content of SiteName1 without displaying Http://localhost/SiteName1/ in the adress bar (it must stay Http://localhost/ ) Http://localhost/SiteName2/ shows the content of SiteName2 and displays Http:/

Windows 8.1 / Windows 10 breaks my ASP.NET / IIS : “Service unavailable”

旧城冷巷雨未停 提交于 2019-12-03 02:31:09
问题 With Windows 8.1 finally released to MSDN/Technet today I came across the following issue running my ASP.NET application after doing an in place upgrade with Win 8.1 RTM: Service Unavailable HTTP Error 503. The service is unavailable. The AppPool has died and shows a status of Stopped The IIS log has nothing There's a clue is in the Windows Application log which contains this error The Module DLL C:\WINDOWS\system32\inetsrv\rewrite.dll failed to load. The data is the error. How can I recover

301 redirect not working in IIS 7

一世执手 提交于 2019-12-02 17:54:08
问题 I need to create this 301 redirect rule: /blog/item.asp?n=12817 redirect to /blog/item/12817 I created a rule in IIS URL Rewrite module with these parameters : Pattern: ^blog/item.asp\?n=([0-9]+) redirect url: blog/item/{R:1} When I test it in IIS it works fine and it created this rule in my web.config: <rule name="Asp classic Legacy 301 redirect" stopProcessing="true"> <match url="^blog/item.asp\?n=([0-9]+)" /> <action type="Redirect" url="blog/item/{R:1}" appendQueryString="true" /> </rule>

Windows 8.1 / Windows 10 breaks my ASP.NET / IIS : “Service unavailable”

孤人 提交于 2019-12-02 16:27:27
With Windows 8.1 finally released to MSDN/Technet today I came across the following issue running my ASP.NET application after doing an in place upgrade with Win 8.1 RTM: Service Unavailable HTTP Error 503. The service is unavailable. The AppPool has died and shows a status of Stopped The IIS log has nothing There's a clue is in the Windows Application log which contains this error The Module DLL C:\WINDOWS\system32\inetsrv\rewrite.dll failed to load. The data is the error. How can I recover my IIS to make it work again? It looks like a simple uninstall and re-install of the rewrite module

301 redirect not working in IIS 7

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-02 07:39:55
I need to create this 301 redirect rule: /blog/item.asp?n=12817 redirect to /blog/item/12817 I created a rule in IIS URL Rewrite module with these parameters : Pattern: ^blog/item.asp\?n=([0-9]+) redirect url: blog/item/{R:1} When I test it in IIS it works fine and it created this rule in my web.config: <rule name="Asp classic Legacy 301 redirect" stopProcessing="true"> <match url="^blog/item.asp\?n=([0-9]+)" /> <action type="Redirect" url="blog/item/{R:1}" appendQueryString="true" /> </rule> But still when I navigate to /blog/item.asp?n=12817 in browser it shows me The resource cannot be

Setting MaxWebConfigFileSizeInKB in IIS8.5

情到浓时终转凉″ 提交于 2019-12-01 16:22:10
I have a web.config file that references a rewrites.config file that is used by the inbuilt IIS Rewrite module. However my rewrites.config file is larger than 250kb, so i have followed the advise on this post . However it appears that in IIS 8.5 (Windows Server 2012) these keys are ignored. I've search the interwebs and haven't been able to find much on IIS 8.5, anyone got any advice on how to increased the maximum.config size? Or alternatively split rewrites.config into smaller files? Aaron Newton You can just create the key . Right click on the parent node in REGEDIT - add a new Key called

url rewriting in mvc4 with razor engine

人走茶凉 提交于 2019-12-01 06:45:11
I want to rewrite following url - http://localhost:99/Product/CategoryLevel?CategoryId=65&ProductName=Vitamins with http://localhost:99/Product/Vitamins , (or) http://localhost:99/Product/CategoryLevel/Vitamins (or) http://localhost:99/Vitamins (or) how to remove (or) hide the querystring from the url (that was shown to the users)? I tried using url rewrite module(iis) and asp.net routing and search for the solution in the internet,but i didn't find right solution for this,please suggest any solutions. You must map this route before all the other route mappings (routes are evaluated in order):

url rewriting in mvc4 with razor engine

心已入冬 提交于 2019-12-01 04:20:29
问题 I want to rewrite following url - http://localhost:99/Product/CategoryLevel?CategoryId=65&ProductName=Vitamins with http://localhost:99/Product/Vitamins , (or) http://localhost:99/Product/CategoryLevel/Vitamins (or) http://localhost:99/Vitamins (or) how to remove (or) hide the querystring from the url (that was shown to the users)? I tried using url rewrite module(iis) and asp.net routing and search for the solution in the internet,but i didn't find right solution for this,please suggest any