url-rewrite-module

How does IIS URL Rewrite handle # anchor tags

狂风中的少年 提交于 2021-02-16 16:24:07
问题 I'm struggling to find any information on how best to handle URLs with anchor tags, like the #foo in www.example.com/index.html#foo Our current situation is trying to use a Rewrite map for a URL with an anchor tag, but it is being trumped by another Rewrite mapping. e.g. <add key="index.html#foo" value="bar1.html" /> <add key="index.html" value="bar2.html" /> <!-- A request to index.html#foo is being redirected to bar2.html, not bar1.html as expected --> Does URL Rewrite include this in the

How to add rewrite rule to Azure web.config so that certain requests are not redirected?

冷暖自知 提交于 2021-02-10 16:19:50
问题 How to add a URL Rewrite rule so that requests from user agents – ReadyForRequest/1.0+(HealthCheck) & HealthCheck/1.0 are not redirected ? I need this so Azure app service health check can work. I found many SO posts about redirecting urls but I can't found SO posts for preventing redirection for certain requests. This post is to add answer to my previous post, but I only want to focus on the real problem because my previous post seems gained attention to the wrong topic. Thanks for any help

Safari Adds Trailing Slash

怎甘沉沦 提交于 2021-02-08 05:28:14
问题 I've got an ASP.NET website that uses URLRewrite 2 to remove trailing slashes from the URL. We noticed that Safari on Mac does not obey this rule. It always leaves the trailing slash in the URL. SEO Moz is showing both URLs which appears to be a potential duplicate content issue. Here is the URLRewrite rule in our Web.Config <rule name="Remove trailing slash" stopProcessing="true"> <match url="(.*)/$" /> <conditions> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> <add

UrlRewrite condition based on custom HTTP header

谁说我不能喝 提交于 2021-02-04 22:15:27
问题 I'm trying to configure a rule in UrlRewrite that has 2 conditions: HTTP header HTTP_HOST needs to match a certain domain (api.contoso.com) A custom HTTP header x-app-version needs to be present in the HTTP request based on this info, I'd like to redirect to a different version of the API in the back-end. Problem The rule is behaving as expected on the first condition. It kicks in when HTTP_HOST matches api.contoso.com. However, it ignores my custom x-app-version header. Assumption So, I fear

IIS URL Rewrite rule to replace part of the URL

你说的曾经没有我的故事 提交于 2021-01-29 05:15:06
问题 I am new to the IIS Rewrite rule and trying to create a rule to replace part of url e.g.www.abc.com/assets/global/xyz.jpg should redirect to www.abc.com**/en/globalassets/**assets/global/xyz.jpg I fiddle around with the following rule but no success <rule name="url replace"> <match url="^(.com/assets/global/)" /> <action type="Rewrite" url=".com/en/globalassets/assets/global/{R:2}" /> </rule> 回答1: According to your description, I have tested on my side , you could use urlrewite rule as below:

How to convert an nginx reverse proxy “sub_filter” to IIS10 URL Rewrite - Outbound Rule?

老子叫甜甜 提交于 2021-01-01 06:09:38
问题 I'm currently using nginx (for Windows) to create the below reverse proxy with respective sub_filter to inject CSS to the HTML. I would like to replicate this in IIS 10: location /files { proxy_pass http://localhost:999/files; proxy_set_header Accept-Encoding ""; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $http_connection; sub_filter '</head>' ' <link rel="stylesheet" type="text/css" href="https://github.io/test/CSS/themes/dark.css"> <style>

How to convert an nginx reverse proxy “sub_filter” to IIS10 URL Rewrite - Outbound Rule?

人盡茶涼 提交于 2021-01-01 06:06:02
问题 I'm currently using nginx (for Windows) to create the below reverse proxy with respective sub_filter to inject CSS to the HTML. I would like to replicate this in IIS 10: location /files { proxy_pass http://localhost:999/files; proxy_set_header Accept-Encoding ""; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $http_connection; sub_filter '</head>' ' <link rel="stylesheet" type="text/css" href="https://github.io/test/CSS/themes/dark.css"> <style>

IIS | Block page specific url except for specific internal IP address

ぐ巨炮叔叔 提交于 2020-05-11 03:23:30
问题 I am trying to block a url page specific (http://www.testdomain.com/login) for all IP addresses EXCEPT for an internal admin IP address. I have no issue blocking the pattern login but I want to test locally to make sure that the internal admin IP is excluded from the blocking rule for /login url. See what I have so far... <rewrite> <rules> <rule name="RequestBlockingRule1" enabled="true" patternSyntax="Wildcard" stopProcessing="true"> <match url="*login*" negate="false" /> <conditions

.htaccess rewrite rule for two GET variables on index.php?

我与影子孤独终老i 提交于 2020-01-06 01:08:11
问题 I'm trying to do a rewrite but I couldn't find it or do it myself. I'm trying to convert http://www.homepage.com/variable1/variable2 to http://www.homepage.com/index.php?var1=variable1&var2=variable2 or http://www.homepage.com/?var1=variable1&var2=variable2 I have tried RewriteRule ^/(.*)/(.*)$ ?var1=$1&var2=$2 [NC,L] RewriteRule ^(.*)/(.*)$ ?var1=$1&var2=$2 [NC,L] RewriteRule ^/(.*)/(.*)$ index.php?var1=$1&var2=$2 [NC,L] RewriteRule ^(.*)/(.*)$ index.php?var1=$1&var2=$2 [NC,L] none of these