views:

49

answers:

3

I Use Visual Studio 2010 with ASP.NET 4.0 and IIS7. When I open my site, the URL looks like this

http://localhost:6549/Website/help/tab/contact-us

I want a friendly URL:

http://mysite/help/tab/contact-us

or anything that will help me to get rid of the Port 6549 from URL

http://localhost/Website/help/tab/contact-us

I use ASP.NET Development Server which is what Visual Studio use when you run a localhost website


Wait !! Please make distinction between "Properties window" and "Property pages" of the project. I always tried your advices, but using "Property pages", and there is no such property like Use dynamic ports on that page. This property can be found only in the "Properties window"

+1  A: 

Edit: I was thinking you can use your host file to redirect the user, but I checked and you can't redirect to a port.

If you have IIS7 on the machine, just make the location of your web development folder into a virtual directory on IIS.

Then you can access it by http://localhost/website/

Ed B
already tried this but didn't worked for me
pixel3cs
How did you set up the virtual directory in IIS? Did you mark it as an application?
David
i just discovered I don't have IIS7 installed, only the ASP.NET Development Server was there, which is installed at the same time with VS 2010. I found this http://learn.iis.net/page.aspx/28/installing-iis-7-on-windows-vista-and-windows-7/ and I'll come back after installing IIS7 on localhost
pixel3cs
@David. Yes, set up the website folder as an application.
Ed B
+1  A: 

Is your solution configured to use IIS and not the ASP.NET Development Server? There is also a property on the web application where you can specify the port (or allow for a random port to be chosen) - port 80 is the appropriate port - this requires administrator access to the process that is launching the web site.

Redbeard 0x0A
by default, ASP.NET Development Server it's used
pixel3cs
+1  A: 

Assuming it's the ASP.NET development server:

To get rid of the port number you need to do this - go to properties of the project - click the web tab - check the specific port and assign 80 There is also a virtual path setting here which you could set to /

cellik
I found the Virtual Path in the Properties Window but there is not "web tab" in the Property Pages of my web application. There are only these tabs: References, Build, Accessibility, MSBuild Options, Silverlight Applications
pixel3cs
I found the "web tab". It is called the Developer Web Server and can be found in the Properties Window
pixel3cs