UrlRewriting for Subdomains - asp.net

In IIS7 using UrlRewrite module I want to do something likes this. I tried everywhere, possibly this is wellknown problem, but couldn't find any usefull solution.
Url "http://tom.mydomain.com" should be read internally as "http://mydomain.com/dashboard?g=tom"
I am using ASP.NET MVC, just in case info is required.

Finally, we have configured our own DNS server to handle this issue. So this question is no longer in my case. However, this seems to be not a good idea to rewrite such url. The Application Request Routing feature in IIS7 is one way to go

Related

Different domain names pointing to subfolders in Azure

Not sure if what I'm describing is possible, but if so I'd like to know how.
I have an ASP.NET Azure Shared mode website with a domain, lets say mydomain.com pointing to it. I have a shop there, which is currently at mydomain.com/shop.
What I'd like is to point a different domain, myshop.com to the page at mydomain.com/shop. Can I do that?
Probably the quickest approach would be URL-Rewriting, which is installed by default on Azure Website / WebRole.
Configuration can be made in the web.config -> more details although you I would imagine if you're using MVC there might a slightly more elegant Routing method, maybe?
I'm not sure if I get your question right, but
you could use the HttpResponse Redirect from the .net framework in order to redirect the response.

Is there a way I can redirect/rewrite URLs is IIS 7 when the application runs the .NET Framework 1.1?

Is there simply a way I can update the web.config file to rewrite or redirect URLs without making code changes to the project?
Before IIS7 came out, I used a URL Rewrite Module from Helicon to do similar things. It's based on regex for the rules, but it's pretty good and it always worked well for me.
It's an ISAPI module, so it's configuration is outside of web.config.
I used the ISAPI_Rewrite_Lite product, which is free. I never used the full-blown version.
I hope this helps.

How to efficiently create facebook-like url-rewriting in asp.net

I'm currently looking into url-rewriting and how it should be done right and hope you have some inputs here.
At the current stage of development only the kind of url-rewriting I'm interested in is adding facebook like behavior to businesses to which we provide services on our site, i.e. www.mysite.com/ShowBusinessInfo.aspx?id=1 should be rewritten to www.mysite.com/HostedBusinessName. - The idea is that when a business registers on our site they can choose whatever the last part of the url should be.
What would be the best way to support this feature? Custom IHttpModule, Global.asax (I'm afraid that this is too slow?), UrlRewriter.net/UrlRewriting.net or a completely different solution.
The site is developed in asp.net and runs on IIS 7.5.
I've actually done something like this before and this is the article I used as a resource: http://stweet.wordpress.com/2010/03/15/creating-a-new-website-programmatically-on-iis-using-asp-net/
This article will tell you how to programmically add a web site to your IIS using C#. Keep in mind that depending on how your IIS and DNS is setup, you may need to also modify your DNS server. You can find various scripts for doing this here: http://msdn.microsoft.com/en-us/library/ms682129%28VS.85%29.aspx
Hope this helps!
If you have fairly simply rewriting rules, I'd use an IHttpModule that attempts to match the URL's LocalPath property with a value in your DB, and then calls context.RewritePath(string).
If you have more complex stuff, then I'd start looking at UrlRewriting.NET or the routing options in ASP.NET.

How do I implement HTTPS in an ASP.NET Project?

I want to implement HTTPS in my ASP.NET application. How do I do it?
HTTPS need not be implemented within the code itself. As long as the code runs under a server that is implementing the SSL, you will have no problem.
Have a look here: Setting up SSL correctly with IIS and ASP.NET
The only thing is to make sure that any code that calls another page should also be under the SSL site, otherwise users will be given warnings. This especially is overlooked with images.
You could start looking at How To Set Up an HTTPS Service in IIS
Maybe this question is better answered in http://www.serverfault.com

Setting Default URL in Web.Config for website (Routed page!)

This is a follow-up on this question.
I basically have the same question as this question, but with a few differences. First of all, my url is http://site/Image/Cassandra/Image.aspx and I want to see http://site/Image/Cassandra instead. This is a routed page where I use ASP.NET routing to translate an url to the one above. But somehow, it doesn't find my page when I don't add "Image.aspx" or anything else ending with ".asmx".
That annoys me...
Since this has to run on both IIS 6 and 7, and because the administrators won't let me have access to the IIS configuration, I need to solve this from within my web application and I think web.config is the place to add the solution. But what is the solution?
(Btw, I know there is some trick with authentication and a default URL in it but that won't work in this case.)
The problem with the URL you would like to have is that IIS6 would require that a physical resource exist on disk, unless you've configured IIS6 to route all requests through ASP.NET. From your statement this would appear to not be the case.
So, assuming that IIS6 is not routing all requests to the ASP.NET pipeline, then there will be no way of providing the exact URL you are wanting.
I encountered a similar dilemma before and overcame it by modify my routes to include a dummy .aspx extension so that IIS6 would be happy. Is there a reason you couldn't modify your desired URL to contain an extension that IIS6 does route to ASP.NET?

Resources