Removing .aspx from URL with an IIS Version 6 server - asp.net

I have a asp.net application that is running on a server that has IIS 6 on it. I want to set-up a redirect so that instead of my page reading www.google.com/About-Us.aspx it just has www.google.com/About-Us. I've seen in IIS7 where you can just write a rewrite into your web config file, but I'm not having much luck with what to do for IIS6. Has anyone else had this issue as well or know of a work around for this?
Thanks!

You should add URL Routing.
More about that (actually this is a solution you need) you can find HERE
Screenshot of page

Related

Can a webform application handle extension less URLS?

Can a webforms application handle extensionless URLS?
The application is running version 4.5
So I want a URL like:
www.example.com/login
to redirect to the actual page like:
www.example.com/users/login.aspx
I am ideally looking for a solution that doesn't require any IIS modification ie. application level only
Sure. There are a bunch of articles that will tell you how. Here are a couple:
https://msdn.microsoft.com/library/dd329551(v=vs.100).aspx
http://weblogs.asp.net/scottgu/url-routing-with-asp-net-4-web-forms-vs-2010-and-net-4-0-series

Asp.net app on IIS 8.5 subdomain redirection

I'm working on some app in asp.net mvc5. I have problems with redirection.
I'm using HttpContext.Current.Response.Redirect("www.google.com"); but the problem is that when I deploy on IIS i have web page on subdomain like somedomain.com/MyApp so when I use HttpContext.Current.Response.Redirect("www.google.com"); it creates link like somedomain.com/www.google.comso this is where the problem is. I don't now how to get rid of that subdomain ?
David
You need to qualify the protocol you are using, otherwise your addresss tring will be treated as a relative path.
For example:
HttpContext.Current.Response.Redirect("https://www.google.com")

ISAPI Rewrite With Azure Web App

I'm not sure if this is the best/correct place for this type of question. But I have an existing .NET website which I am moving from our dedicated EC2 server to an Azure Web App.
However, this current site uses an .htaccess file with about 200 redirects (301 from old urls to new ones) which is powered by ISAPI rewrite (Which was installed manually on the Win2008 server).
I need to keep these redirects, but wondering how everyone else deals with permanent Url redirects on .NET applications when moving to an Azure Web App (From a dedicated server that had ISAPI rewrite installed)?
Putting them all in the web.config seems a little odd to me? And I don't know how that would affect performance?
Any advice or pointers would be appreciated as always.
I always put them in the web.config.
If you think it will be too messy, you can put them in a separate file and use the configSource attribute to link to the file.

IIS 7.5 doesn't open aspx, html pages

I have two ASP.NET sites on my IIS 7 (Windows Server 2008 R2)
First one works perfect, it opens default.aspx page any other aspx pages as well as html, but second site doesn't open neither .aspx nor .html links, so for example if I try to open http://mysite.com/Default.aspx url, it just shows an empty page without any content or any error.
What it could be?
Thanks.
Well, many things can be broken.
Few tips:
Start Chrome, Firefox (with Firebug addon) or Fiddler or any other http proxy and check what the server is sending - is it HTTP 200, 404, something else?
check IIS logs c:\inetpub\logs\Logfiles\w3svc
check EventLog
compare httpmodules in working website with those of the website which is not working
ensure correct app pool with correct .net version is set for site
try to convert website to webapp
if all fails, delete website and create it from scratch. If it works it may suggest that IIS metabase was damaged.
Another workaround that I suggest:
Open the "hosts" file using Notepad in C:\Windows\System32\Drivers\etc\hosts
then add
127.0.0.1 YourWebsite
Next, try to add binding to a site as suggested here at (http://technet.microsoft.com/en-us/library/cc731692%28v=WS.10%29.aspx)
I hope it helps you.

IIS 7 URL Redirection

Well, having a small problem.
A 3rd party is connecting to our API, however they are using the wrong URL and the URL no longer exists on our system. They said the had to revert to some backup code.
Problem is that they have no developer that knows how to fix the code to point to the right URL.
So, my question is how can I take a nonexistant URL in IIS 7 and have redirect to a the correct URL?
URL they are trying to use is (which does not exist):
http://www.mysite.com/page1212.aspx
The URL they need to hit is:
http://www.mysite.com/page1919.aspx
How can I cause the redirection to happen server side using IIS 7.0 only for this? I want nothing to change functionally with the website other than this simple redirection.
Check out IIS URL Rewriting.
Here's also a very detailed tutorial on how to use redirecting on IIS7. Scroll a bit down and you'll find what you're looking for.

Resources