point to virtual directory in IIS - asp-classic

I apologize if I am not using the right technical terminology, but I am trying to be as clear as possible, I hope my post makes sense.
I have added a local classic ASP website in IIS 7.5
Sites
csr < website
The physical files location: c:\projects\webapps\csr
The URL in the browser: http://localhost:82/orders.asp?.....
My question is: how do I have to change the configuration if I want the website to open in the browser using the following URL: http://localhost:82/csr/orders.asp?....
Thanks.

Change the website's path to c:\projects\webapps. Then http://localhost:82 will point to c:\projects\webapps and http://localhost:82/csr will point to c:\projects\webapps\csr
If you want http://localhost:82 to point to some other folder, that's fine too. Just add a virtual directory to the website, name it "csr" and give it the path c:\projects\webapps\csr, and you'll be able to browse to http://localhost:82/csr.

Related

ASP.Net Accessing Server Filesystem

I am having trouble accessing information on the server my website it on. As the website was originally programmed with VB.Net, I cannot change the language without having to completely reboot the website. The way the website and server are configured, I can only use ASP.Net and VB.Net.
I am needing to add a section where they can create folders, edit folder names, and upload pictures and text documents on the server through the public website. I tried using parts of the FileIO, Server, and Http that should have worked, but none of them did. Most of my research is about local files and text documents.
I have not been able to find any information that works. Can someone help me? Thank you.
Firstly, creating a virtual directory in ISS mapped to somewhere on your disk would be a good start. This way you have a separate folder for user data in a folder with write access (make sure IIS has write access to the folder!), and the folder is not affected by website deployments.
Secondly, you might need to resolve absolute path for most of the System.IO.File calls. See How to convert a relative path to an absolute path in a Windows application?, just you will need to convert this code to VB.

classic ASP, relative vs absolute path

I'm having trouble figuring out relative vs absolute path in classic ASP.
In IIS 7.5 I created a website that points to c:/inetpub/wwwroot/websitename.
In that website I have a page that displays the links to some mp4's videos.They are located in c:/inetpub/wwwroot/websitename/DVD.
Those links point to localhost/websitename/DVD/videoname.mp4
In some computers clicking in one those videos it gives me an error.Basically, it says that the file does not exist in c:/inetpub/wwwroot/websitename/websitename/dvd/videoname.mp4
How would handle this problem.
(I hope is clear enough)
Tanks!
Simply use such path:
videoname
This way you don't have to mess with localhost or websitename in the links, it will just look for folder named "DVD" in the same place as the file with the link and take the files from there.

.aspx file doesn't work on IIS website

I have a big solution that contains a lot of .aspx file, basically it's a big sln file for my whole server
I wanted to add a website in my IIS server that contains inside a child directory within the root site folder, for example:
my-tools.com physical path is D:/MyWeb <-- Working well
I added a secondary sites, with no relation to the upper site called mysite which is like that:
mysite.my-tools.com which its path it D:/MyWeb/MySite/
If I try to reach mysite.my-tools.com/M_Index.aspx file it give me an error tells me it's not found, however, when I try to view a .jps file from the same directory (e.g mysite.my-tools.com/test.jpg) it returns just find.
it's important to tell that all the pages share the same solution, what do I do here and why it is not working? can anyone tell me?
thanks a lot
having the folder separated like you do is a step in the right direction. next step is to configure IIS to point to that separate folder. then you would need to create a DNS entry for your sub-domain at your DNS host. "subdomain.domain.com". You would be creating a new site, so you could use the same IP address, as long as you add the proper host headers for each site.

File not found error in Asp.net 4.0

On Local host,my solution works fine but on server when i deploy ,it gives that file not found error. and the error message is something like this.http://localhost:27375/favicon.ico
I don't have any such file in my application.I tried to create on in the root folder but no luck.any help is highly appreciated
Your favicon.ico file should be in your root directory for the web site.
It looks like your application is still trying to connect to the localhost in order to display the favicon. Are you hard-coding your URL to the favicon with a http://localhost:27275/favico.ico address?
To build on what Internet Engineer said, using ASP.NET, you can use a relative path prefaced with ~ or /. So, you can use ~/favico.ico or /favico.ico in order to reference your icon file.
First check in web server if you can see the file directly in the browser:
http://productionwebsite/favico.ico
If the file is there, now you need to check that the code is using relative paths. Most likely this is coded using absolute paths.

Need help setting up simple Virtual Directory in IIS7

Noobie question...
Using IIS7, I am trying to create a virtual directory for the folder that contains my video files, but can't get my head around how it is done.
For example...
The existing address is http://www.mydomain.com/members
which points to C:\wwwroot\mydomain\members
I need http://www.mydomain.com/flash-members to point to the same path.
The existing IIS path to the members folder is Server\Sites\www_mydomain_com\members (has application icon)
Any help is appreciated.
For your example, assuming www_mydomain_com is the Site (little world icon), you can do this by:
Open IIS Manager
Right-click the web site, select Add Virtual Directory
In the Alias field, enter flash-members
In the Physical Path field, enter your path (C:\wwwroot\mydomain\members)

Resources