How to prioritize IIS URL rewriting rules? - iis

Is it possible to make URL rewriting rules executing with a specified priority order (i.e. one rules before another)?

it depends on your code, you manage it with your code.
i use "if else" structures and rewritepath method in my application_request event and manage my url rewriting.
but if you had some regular roles, so use the roles in web.config.
sometimes you had somthing like that
www.yoursite.com/products/34
and you want to rewite it into
www.yoursite.com/products.aspx?id=34
in these cases i offer to use the role in web.config.
but sometime it not as easily as this one.so use the application_request method and because you manually rewrite you path you can change their priority.
finally :
my offer is use the application_request event and rewrite your urls in this special case ;-)
if need more help comment then i will edit this answer dude.

Related

How to make Azure Rules Engine make all incoming uri paths lowercase?

Currently I have tried a few different combinations.
Essentially what I need to do this this:
www.mydomain.com/mYpaTh needs to rewrite to: www.mydomain.com/mypath but it needs to do a toLowerCase for every incoming uri, essentially making the uris case insensitive. The method cannot effect query parameters or file extensions.
This needs to be done as a wildcard, not as a specific case, most examples found online have it for only one scenario, to set up as a basic url rewrite. I need it to be done as follows:
Incoming uri contains /[A-Z] then rewrite to /[a-z] - not sure if azure actually allows this. WIld cards don't seem to work for the standard subscription, but not sure if someone has made it work in some way. I was able to get this to work in AWS cloudfront using basic javascript toLowerCase method.
For example:
Azure CDN Rules Engine

Orchard how to make homepage address also accessible by index

Supposed my home page at the moment is: www.myorchard.com
How do I make it when user access www.myorchard.com/index also goes to home page?
You don't want that. For good SEO, a resource should always correspond to one URL. What you want to do is redirect from one to the other, permanently. You can do that either using IIS's rewrite URL module, or through this Orchard module: http://gallery.orchardproject.net/List/Modules/Orchard.Module.Contrib.RewriteRules
The former solution is to be preferred for less overhead, but if you think you're going to have to manage lots of rewrites often, the latter is more convenient.

Orchard multi tenant with multiple hostnames

Is it possible to have multiple hostnames pointing to the same tenant. E.g. I want my-website.nl and mywebsite.nl pointing to the same instance.
That would be bad for SEO. You should pick one and have the others permanently redirect to it.
UPDATE: to redirect, you can use IIS url rewrite by editing the web.config, or you can use the Rewrite module for Orchard: http://gallery.orchardproject.net/List/Modules/Orchard.Module.Contrib.RewriteRules
Although I don't recommend it, you can also specify a comma-separated list of host names in tenant configuration and get the result you wanted initially (I should have remembered that as I wrote that code).

Dynamically creating URLs for other websites

I'd like to know how websites have created URLs with other domains like these on trafficestimate.com.
I'm guessing it's some .htaccess stuff to redirect domain names to a dynamic page?
Thanks
Your URL has an GET Request. So when someone calls the page http://google.com/search with the parameters hl=en, safe=off etc., the page can process those parameters. So for instance safe=off means that you want to get back any search result. The q=site:... is your search string. In this case Google will look it up in its database and give you the results. So when you call this URL there is probably no .htaccess processing done. However you can process the URL and GET request with .htacces and i.e. redirect the user to another page.
Maybe you'll describe a bit further what exactly you trying to do/want to know. This makes explaining easier.
EDIT: After reading Gumbo's comment I looked at the Google result page. So maybe your question means the trafficestimate-URLs. They look like http://trafficestimate.com/example.org. This is really a good case for .htaccess. So using .htaccess they take the URL and redirect it to http://www.trafficestimate.com/websites/?domain=example.org. Here you have again a GET request and an application builds the page.
Some URL rewriting is probably involved. Otherwise they would have to create an existing file for every possible request.
Using Apache’s mod_rewrite in a .htaccess file is one option. But since the server identifies itself with “Microsoft-IIS/7.5”, they are probably rather using ISAPI_Rewrite, a mod_rewrite derivative for Microsoft’s IIS.

Can IIS 6 serve requests for pages with no extensions?

Is there any way in IIS to map requests to a particular URL with no extension to a given application.
For example, in trying to port something from a Java servlet, you might have a URL like this...
http://[server]/MyApp/HomePage?some=parameter
Ideally I'd like to be able to map everything under MyApp to a particular application, but failing that, any suggestions about how to achieve the same effect would be really helpful.
You can set the IIS6 to handle all requests, but the key to handle files without extensions is to tell the IIS not to look for the file.
http://weblogs.asp.net/scottgu/archive/2007/03/04/tip-trick-integrating-asp-net-security-with-classic-asp-and-non-asp-net-urls.aspx
You can also create an ISAPI filter that re-writes urls. The user enters a url with no extension, but the filter will interpret the request so that it does. Note that in IIS it's real easy to screw this up, so you might want to find a pre-written one. I haven't used any myself so I can't recommend a specific product that's any different than what you'd find via google, especially as I don't know your specific use case. But at least now you know what to search for.
You can also rewrite your urls using ASP.Net:
http://msdn.microsoft.com/en-us/library/ms972974.aspx

Resources