HTML - Linking To Root
Hi guys,
I'm wondering if there is an easy way to provide links or image links to a file in the root directory of my domain. I know there's the "/" method but it will not do for me because I maintain the files offline on my PC, and if I used "/" then it will not refer correctly. Example: Code: <IMG SRC="/example.gif"> This will work 100% of the time when it's uploaded on the web, regardless of which directory the HTML file is at, I will still open the same "example.gif" at the root dir. Perfect. But since I'm maintaining the files offline (before uploading), this causes a problem as I will have numerous "broken links". FYI I even tried to map my folder to a drive (W, or placing the entire file system on a USB drive, but none of those work. I realise I could use Code: <IMG SRC="../../example.gif"> and so on, but shouldn't there be an easier method? Similar TutorialsI am working on an ebook site and must provide it to a service that hosts ebooks and does marketing and other things for their clients beyond simply hosting. They have given me an instruction that I don't know what it means, and when I try it, it breaks my ability to preview the work I'm doing. I can only assume that whatever they're doing really needs it to be this way and that it won't truly be broken in their database. Btw, I'm building the individual pages and their database is linking the pages in the prev/next buttons. Here's the instruction: Make sure to label any links or images in a global, root-based manner, since once it's called on from within another folder the links will be broken if you do not. Example: img src="static/contact.jpg" SHOULD BE img src="/static/contact.jpg" What does it mean? Do I need to take any precautions not mentioned here? Sorry but any question I ask them just seems to baffle them and makes me wish I had never asked it. Thanks, Gary How would you make a directory before the root. Apple.com for example if you click on store, it will go to store.apple.com I want to make a feature for iphones on my website, so that if an iphone is viewing it, it will be redirected to mobile.website.com or something like that. I dont know how to make the root before the website =/ How do u specify the root folder in HTML without specifying an absolute address? (e.g. does "..//" mean root folder? I mean, like in ms-dos you could specify ..\\ to go back to the root folder) I'm building a menu by using php includes, e.g.: My index file contains: <?php include ('website/menu/titlelogo.html'); ?> In the titlelogo.html file, there is a link to titlelogo.jpg and lots of other stuff, from the perspective of the index file. It works fine until I change folder. Then of course, the stuff in the titlelogo.html is not from the perspective of the new folder. So I need to specify a root address to get around this. Absolute addresses aren't accepted for php (i.e. by absolute address I mean http://etc.) Please excuse me if I'm not describing this in the right terms. I come from a programming background, I'm only a basic html user. Its breaking my website, and no google searches have helped me find a solution! Anyone know how I can sovle this? Thanks I have a little problem with my server, I know it is EASILY solved, but I don't know how. The pages work fine if they are in ROOT, like index.html in ROOT is fine, but when I make a new HTML in a subfolder, ROOT/folder/index.php All the coding messes up and cannot load the files from the root. E.G: My CSS is in my root, cssmovietick.css, this works fine for the php files in the root, but when I go into the sub folder, it cannot find it. Here is the code to find the CSS. Quote: <link href="cssmovietick.css" rel="stylesheet" type="text/css" /> I'm pretty sure you understand Hi gurus, Excuse my rookie question. I am trying to build a small HTML page which has a formula in it . Please see attachement. Its something like: M = nth Root of ABC ----------------------------- - 1 _____________ XYZ I am trying some combinations of and √ but cannot make it work. Is there a way to do it other than using the image tag. THanks, KOn Hello, NVM. solved, delete please. Hi all, I am trying to get the faveicon on my webpage. I have read some places that IE needs the image to be in the root folder of the web server. Is this true? Has anyone got it to work with the image in a different folder? The reason I ask is because I have some trouble accessing files in the root folder. If it is possible not to use it I would prefer to. Thanks in advance for any help, Jehan Hey. I was wondering if this php code can be put into html? HTML Code: include($phpbb_root_path . 'PATH' . $phpEx); Or is there some other html code with does that same job? So here's the sitch: Our website, Watershedpdx.com, works from its outside IP address UNLESS you are inside our local area network. It's a Comcast issue, and their router seems unable to rout internal requests for our own IP from the internal and around to the router. I know I could modify the .hosts file on every computer and such, but for now, I've opted for a slightly different solution: If I'm inside the building, I check our own website with it's local IP: http://10.1.10.197 Now, the issue comes up because I'm streaming video to the web at http://10.1.10.197:8079 and http://10.1.10.197:8078 Is there a way to reference this in the code without the IP address? For this to be visible to the internet, I link it in the code as http://watershedpdx.com:8078 - but then the computers in the building can't see it. Is there a reference like http://..:8078 that would work? Hi all, Sorry for such an elementary question but up until now I have always used ../ for my references. So I don't have to duplicate code I decided to use ~/ for some referenced links and it doesn't seem to work. Get 404 on the requests. Ok.. what am I missing? Much thanks! s-one Hi, I'm running a personal server on my PC and have an image gallery script that serves up files outside of the root directory. I am trying to add image tags to folders on my hard drive and it will not display. If I go to the address directly, it shows up fine. Here's what I'm working with: <img src='file:///media/sda3/pic/toronto/beach000.jpg'> shows nothing but going to the address does. Anybody know what to do? I'm trying to fix up my code a bit so all the files I'm pointing to are relative to the root of the site. Most of my links used to look something like this (all these link examples came from same file)... <link href="css/styles.css" type="text/css" rel="stylesheet"> <script src="scripts/jquery.min.js" type="text/javascript"></script> <?php include('includes/header.html');?> <img src="images/maps/pic1.jpg"> The above was fine as long as my site stayed small, with few pages all in same directory. However, bigger projects require pages in different folders, sometimes in subfolders, yet all these pages share certain characteristics - headers, footers, etc. So I need to start specifying links to those files relative to the root. Here are the same examples, but now starting from the root of my site. They all work, except for my includes. <link href=" / css/styles.css" type="text/css" rel="stylesheet"> <script src=" / scripts/jquery.min.js" type="text/javascript"></script> <?php include(' / includes/header.html');?> <img src=" / images/maps/pic1.jpg"> Any idea why the includes won't work? Works fine as long as I don't put that / in there. Wicked simple question: I have three images located in my "images folder" My Top level looks like this -images- (folder) -party- (folder) index.html In my "party" folder I have a page called "events.html" and I need to know how to call an image in my "events.html" located on the top level folder "image" I know if i move the event.htmls to the top level I could call it by this: <img src="/images/picture1.gif"> However I DONT want to move the events.html, so how do I call the image? O and I am not looking for the answer : put the "http://www.sitename.com/images/" in the image tag ANY HELP THANKS!!!!! Hi all, I have a query that I hope somebody can help with as my site has been brought to a standstill because of this problem. I have just posted the new version of my site online and I have a folder below the domain root which contains things like database info, form scripts etc. When I process the form I get a 404 error. the action is something like HTML Code: action="../includes/process_form.php" There is no need to any output from these files as they process the information and direct to the relevant files above the domain root using php header scripts. At the beginning of most of my files I have the following PHP Code: <?php $security = 'secure'; require('../includes/default.php'); require('../includes/error_handlers.php'); require('../includes/db.php'); ?> and there is no problem with these whatsoever. I had all of the scripts working fine when I tested them at domainroot.co.uk/take2/public/ domainroot.co.uk/take2/includes/ Does anybody have any ideas why this is happening Any help would be appreciated John hi again, i think that i know the answer to this question...but i needed reassuring. basically my website's hierarchy is pretty confusing but it seems to link fine on my computer and everything, then it didn't link on the school computers but i solved that problem because all that was wrong was the file pathways were different. Now however when my teacher tries to open my files, all she gets is that file that cant be found stuff. Do you think maybe the problem could be that my files are too complicated and that maybe i should put all my pages in one place and then all my other files in folders underneath those... please tell me your advice, with many thx Sam Below are two notepad docs. I want to add a link from one to the other. Whenever I add the <a href="..... "></a> nothing shows up when I view the webpage. What am I doing wrong? Thanks. FIRST DOC <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd"> <HTML xmlns="http://www.w3.org/1999/xhtml"><HEAD><TITLE>Departments</TITLE> <META http-equiv=Content-Type content="text/html; charset=windows-1252"> <META content="MSHTML 6.00.6000.16544" name=GENERATOR></HEAD> <BODY style="text-align:center; font-family:verdana,helvetica,san-serif ;background-color:#c0c0c0"><!-- 2D departments Lastname Firstname --> <H1>Business and Information Technology</H1> <H1>Health</H1> <H1>Law Enforcement</H1> <H1>Communications and English</H1> <H1>Math and Science</H1></BODY></HTML> SECOND DOC <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Culinary Arts Recipe</title> </head> <body> <!-- 1G Recipes Lastname Firstname --> Hawaiian Chicken <hr size="2" width="100%" /> This dish can be seved quickly and easily. Boil and debone chicken. Add 1 can of your favorite cream of chicken soup to the chicken. Make 2 cups of cooked rice. Prepare plates immediately before serving. Lay chow mein noodles, rice, chicken, crushed pineapple, green onions, shredded cheese, sour cream, tomatoes, and coconut. </body> </html> hello i am wondering if it's possible to load content into a div by clicking a link in div 1 and changing what is shown in div 2 and clicking a link in div 3 would change what is shown in div 4 i have attached a generic png of how i would want the page to look....and to give a better idea of what i am wanting...any idea's as to how to do this would be appreciated...but be prepared depending on your suggestion i may need some help with how to get it accomplished. Hello everyone! This is my first thread, and I need some help. I just started developing my site hosted by godaddy.com and I am doing all my html and through dreamweaver and uploading new content through dreamweaver also via FTP. The problem I am having is i am tryingto add new pages that link off my HOME PAGE. For example: CONTACT US, ABOUT US, PICS, and so on. I have made this types of pages but I'm not sure why they are not linking right? What address should I be point the CONTACT BUTTON to? My site is www.adiktedapparel.com Any help would be great!!! THANKS! Bill C. Greetings to all. I have been trying to sort this problem for a very long time. I have 2 frames on my web page, one is the contents. Can I link to a specific part of another frame? I don't think HTML allows this - or does it? Help please. First off, I would classify myself as having a basic working knowledge of HTML, but I'm far from experienced. I use Expressions (I know, first mistake), and do at least 50% of the work in the code view window. I'm having a problem right now linking a PPS document. I made the PPT and saved it as a PPS, and linked it using <a href="images/anamaited.pps" target="_blank"> When I preview the website on my computer and click the link the document opens in a new explorer window as a PPS, but when I publish the site and click the link it downloads the document and opens PPT. I don't want visitors opening my presentation in PPT, is there anyway to have the pps display in a browser window or do I have to convert the PPS into flash? If I need to display it as a different file type, I need to do it for free, any suggestions? -edit- wanted to clairfy when I click the link on the live site, it actually opens MS PowerPoint, not a new browser window as the tag specifies. |