Reputation: 51064
I'm debugging a site that is deployed to the site root on the production server, but in my local copy, under the built-in, debugging web server, the URL's include the 'site name'. E.g. my local site is 'PVLive', so all URL's are 'localhost:nnnnn/PVLive/mmmm.aspx'. Certain URL's are hard coded in the site's pages to use paths relative to the root, e.g. I get errors when code tries to redirect to 'localhost:nnnnn/Index.aspx'.
Can I do something to keep the 'PVLive' site name out of the URL's?
Upvotes: 1
Views: 924
Reputation: 13125
Yes you can change the url that your site is run on in cassini (the built in dev server).
I have written an article about this before which you can read here:
The steps from the article are:
But you should read the article if you like screenshots and some background info.
Upvotes: 4
Reputation: 1262
The best way is to test it as the root on the dev machine. In my opinion, the closer you dev environment, mimics the production environment less post roll-out issues you have with broken links.
If you dev machine is Windows server version that you can host it as root on a different
port.
If you machine is Windows Xp you can use iisadmin.net to host IIS on different ports similiar to Windows Server.
Remember this is the non-answer so negative votes would be please avoided
Upvotes: 0
Reputation: 33857
Can you change your hard coding?
e.g. Response.Redirect("~/Index.aspx")
will build a path relative to your root.
Upvotes: 1