Configure an IIS Site to default to non-root directory? - iis-7

Say I have a directory structure like so:
/public
/public/company
/public/globals
/public/globals/images
/public/jobs
/public/jobs/it
... etc.
What I would like to do is to be able to configure an IIS Site to load from /public/company when visiting the domain root. I know I can change the site to /public/company, but if I do that, I can't seem to reference the /public/globals directory to obtain images, videos, and other items used across the site.
The other problem is accessing /public/jobs with a domain/jobs url... although I suppose virtual directories can help there, but then I would assume that I would still run into problems trying to access /public/globals for images and other things.
Any ideas? Am I not doing this right? I'm used to using Apache... obviously a very different environment...

Create a Default.aspx page in the root, and on that page, run this:
Response.Redirect("~/public/company/destination.aspx");

I seemed to have found the answer. I set the default path of the Site to /public/company, and created a Virtual Directory called "globals" that points to /public/globals. Now I can reference images via the Virtual Directory like so:
<img src="/globals/images/awesome.png" />
I suppose I just need to create virtual directories for everything under the sun for the rest of the site then.

Related

Accessing folder outside the website directory in asp.net

I have around 20 websites created a single web-server, now i have made a tool which will be common for all the websites, so i have a common user-control, which i am using on .aspx file inside all the website
Now i want to keep these user-controls in a location outside the website directory so that i can access these same control to all the websites.However i cannot find a way to get the directory outside the website's root directory. I googled around and saw the option to make the directory as virtual one, so that it will be accessible to the site, but here i would have to link the folder to one website at a time, so it would be same keeping controls in separate websites, which i want to avoid for update reasons.Can anyone tell me how can i achieve this.
Hi In rough unchecked code something like:
You can access like this.
webRootPath = Server.MapPath("~")
docPath = Path.GetFullPath(Path.Combine(rootPath, "..\Documents/MyDocument.xml"))

.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.

Interacting With Folders Outside The Root/Web Directory With Dreamweaver (CS5)

Using FileZilla, I can access folders that are outside my web directory. How can I do the same with Dreamweaver so that I can edit the files and automatically save/upload all through Dreamweaver? I currently can only access the web directory.
I know how to include them with PHP, but I would like Dreamweaver to find/access them.
Thank you!
You would have to set the Site Definition (both local and remote) paths to look one level higher than you currently have it. So if the local path is
My Documents/Web Sites/This Site
you would change it to
My Documents/Web Sites/
and if the remote is:
/user/home/domain.com/
change to
/user/home/
The problem you are going to run into is that Dreamweaver doesn't work well when set like this. It assumes the Remote path is the public web root and will create all sorts of files and folders there automatically and DW expects those to be in the public root. Also, things like setting paths to includes and images automatically will start to not work as all paths will start outside of the public web root.
Best to leave it as it is and use an external FTP program to handle the files outside of the web site.
We've bumped up against this situation previously where the desire was to have the PHP include files be moved outside the public HTML directory. JCL1178's answer is absolutely conceptually correct.
The actual implementation was to duplicate the site (under "Manage Sites") and essentially create a separate site for the "includes" directory that would go one level up. So the "Root Directory" setting was normal (in our case "public_html/" in the main site and we removed "public_html/" from the Root Directory setting in the "includes" site, effectively causing the path to go one level up.
Definitely not an ideal situation/workflow, to say the least, as you'll end up with two site definitions for one site (which can cause other issues); but Dreamweaver is what it is. We were working on a project offsite that did not allow for anything other than Dreamweaver to be used, so this is what we came up with to comply.
As an added note: we were only able to implement this solution because the webhosting plan allowed us to get to the root. If you're on a webhosting plan that is strictly limited to the public directory, the whole thing will be DOA.

Main Site With 000WebHost

I am trying to create a site with xhtml I have it done I just need to figure out how to upload it
I am using 000webhost as my web hoster but whenever I go on my main page it says
index of/
then it says all of my sites
I want to go directly to m main site
how do I do that?
You should go to:
Members area,
Login,
Select in Action GoTo Cpanel and then:
You should configure your FTP servers, upload an index.html or index.php file and put your main information there.
EDIT:
You should upload everything to your public_html folder always, you should see a file that should say do_not_upload_here before that folder.
Public html is what what it sounds like. The html container folder that contains what will be visible*. (*VERY rough explanation)
You can use their file manager or an FTP client for this pourpose.
BTW beware of the affiliate programe fo 000webhost, check it out, total hoax (the web hosting is very good for being free).
I´ll gladly expand if you have any doubts.
Here is a good FTP basic tutorial:
http://www.youtube.com/watch?v=I85sldEvLuY&feature=related
Do you have an index.html file in your root directory with your host? Without one of those (or another similar index file), you will just see a directory listing of your site.

2 drupal instances trying to access same set of files

I have set up 2 drupal instances pointing 2 codebase with a common database
www.abc.com points to folder /var/www/abcfolder
mywww.abc.com points to folder /var/www/mywwwabcfolder
The content is uploaded via mywww.abc.com and www.abc.com is used for general viewing. I have used domain access module where mywww.abc.com is an alais to mywww.abc.com
I want that all the files that are uploaded should be maintained in a common folder i.e. in /var/abcfolder/public/sites/all/files for both urls
I tried changing the file system path via admin/file-system to ../../abcfolder/public/sites/default/files since the path should be relative to the drupal installation folder. However on uploading a file, I get a file not found error.
Any help to resolve this issue would be appreciated?
Should I change the htaccess file in any one of the codebase? If yes, what should the change be?
Regards,
Loveleen
How about trying this:
Store the files in /var/www/abcfolder/sites/default/files. Create a symbolic link from /var/www/mywwwabcfolder/sites/default/files to /var/www/abcfolder/sites/default/files
Look up symbolic links in linux if you don't know what they are. If you're using windows you can still do symbolic links but they are more complicated.
[BTW I am not sure why you are doing this complicated setup. Reconsider using domain access unless you really need to. Is it necessary to have two sites like this? ]

Resources