IIS - Rewriting URL with %2520 - iis-7

I am trying to rewrite a URL with "%2520" in the path, to another URL.
The URL looks like this:
"www.example.com/this%2520url/index.html"
I tried several different RegEx methods, but with no success yet.
I'm using IIS 7 with the URL rewrite module.

Related

Itelligencia url rewriter and slug like url's in asp.net webforms / IIS

We have inherited an old asp.net 4 webforms project that uses intelligencia url rewriter.
Currently, the product URLs look along the lines of and work fine : -
https://somedomain.com/Catalog/d4d468e8-1fe8-4648-8acf-0aac0d0d120f
Is there anyway to, instead, have something like : -
https://somedomain.com/Catalog/name-of-some-product
which would load the same as https://somedomain.com/Catalog/68e8d4d4-1fe8-4648-8acf-0aac0d0d120f
There are rewrite rules in the web.config file but nothing I can see relating to slug like urls - can it be done with Intelligencia on IIS ?
Thanks
Sm
This is all about routing so you need to modify the route parameters file to get what you are looking for. You should be able to find a reference of it in your global.ascx.cs file.

ReWrite rule for IIS 7+

I have a site that generates the following url structure that I would like to rewrite.
current url
domain.com/Store/catid/20/prodId/50/pair-of-socks.aspx
desired url
domain.com/pair-of-socks.aspx
It really depends on how many edge cases you need to cater for. A simple solution would be:
Match URL (\w+/)+(\w+.\w{3,4})
Rewrite URL {R:2}

IIS 7 URL Rewrite doesn't work if the url has a question mark in it

I'm using the URL rewrite feature of IIS7
I'm trying redirect a URL like this
example.com/?parameter=abc
to a URL like this
example.com/somedirectory
the URL redirect works well if the source URL doesn't contain a question mark in it.
pls help
-Vivek
IIS7 redirects don't by default match query strings in the pattern so you have to add a condition as well as the pattern with {QUERY_STRING} matches the pattern parameter=abc

ASP.NET URL rewriting and redirecting

I am trying to wrap my head around a URL rewrtie / redirect project I need to work on. We currently have this url: http://www.example.com/Details/Detail.aspx?param1=8&param2=12345
Here is what the rewritten URL will look like: http://www.example.com/Param1/8/Param2/12345
I am using the ISAPI_Rewrite filter to allow for the "nice" url and make the page think it is still using the old url. That works fine.
Now, I need to redirect users, if they use the old URL, to the new URL. I figure I would need to use a combination of the filter and an HTTPModule / Handler to perform the redirect.
Any ideas?
Have you tried IIS URL Rewrite?
If you are not going to go down the System.Web.Routing (or use ASP.NET MVC) path then I would have a look at this link.
Using a HttpHandler would be your best bet. That way, you will be able to track all incoming requests, filter out the old format URLs and redirect them to the correct pages.

IIS7 URL Rewrite with dynamic subdomains

My goal is to implement the following scheme using the subdomain and path as attributes:
Use a wildcard DNS entry that routes any subdomain to the root site:
Example:
*.example.com
ex: http://xyz.example.com
to
http://example.com
Next I want to rewrite the requests to point to a specific page, passing both the subdomain and the request path as attributes.
Example:
http://xyz123.example.com/images/header.jpg
to
http://example.com/get.aspx?id=xyz123&path=/images/header.jpg
I've seen several questions on here regarding similar goals, but not quite the same. I'm new to using rewrite rules, so any help is appreciated. I will update this as I make progress.
for IIS7, url rewrite functionality is built-in. Rules are set in web.config. For IIS6 you need an ISAPI dll that does the same for you. Use IIRF, it works just fine.

Resources