Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

links for windows/apache

Status
Not open for further replies.

conntaxman

Programmer
Aug 7, 2003
55
US
I cant get any of my links to show up on my webpage,It will only high light it,but when you click on it nothing happens.I tried many diffrent ways .here is one.
<p><a href="c:\Program Files\Apache Group\Apache2\htdocs\image\electrical\electrical.html">Electrical</p>
Could anyone see anything wrong.
On the server that Im paying for there is no problem.Im not useing that link the way it coded.
John
Thank you
 
I looked in my error log and have this error.
[04/Nov/2007:14:36:44 -0800] "GET /C../electrical.html HTTP/1.1" 404 311
John
tks
 
No the links are not opening up on the website. I thought they were ,but that is from the other server ,the one that I pay for.
sh.. and I thought I had it.
help.
 
When I first went to the site I clicked on the "electrical" link and I got a messed up url. It had a path rather than a url. The url is relative to the DocumentRoot and the path is a specific path on the hard drive. When you call for a file use the url. In short this:

c:\Program Files\Apache Group\Apache2\htdocs\image\electrical\electrical.html

should be:


Thai is because this:


is equal to this:

c:\Program Files\Apache Group\Apache2\htdocs

I looked at your code and see a few things I also want to point out. I seems like the buttons are in the same directory as the other graphics but are called from a directory called /image rather than images. This could be a typo. You also use both the forward and back slashes in your urls. This might get apache a little upset with you. One more thing I want to point out is spaces. Spaces in a path give apache fits but it seems to work when you have the path in quotes. I'm not sure how it deals with them in a url. Your images have spaces in their names so that means spaces in the url. The problem with the links not working may be because of how the Alias directive is written in httpd.conf. If the /image directory is aliased can you copy and paste the line here. I would also like to see the directory container.
 
I see you are working on it as we speak. Things keep changing on me. :)

 
Rhythmace.
tks for your post,let me first say,you guys are great.I just wish i was as smart as you guys.
well I got the links working ,so far.here is what I did.
<a href="../links/electrial/electrical.html
and that seem to work just fine.If I use the it wont work. it comes up parent directory.
I will strighten out the slashes like you mentioned,that happened when I called it up in the browser cut and pasted in.and Ill get those spaces out,i didn't even notice them.As for the Alias directive I never touched that in the config file.here it is.
Alias /icons/ "C:/Program Files/Apache Group/Apache2/icons/"
<Directory "C:/Program Files/Apache Group/Apache2/icons">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>

I hope that is what you wanted.
well let me go and do some work on this.I think that Im wearing out googles looking up so much about this. ha ha
Let me thank you again.
and have a nice day.I live in ct.Its starting to get cold here now.also getting not to like snow.at 60 ya dont need it.hee hee
c
u
later Johnny
 
Rhytemace.I think I found out the problem for the images not showing up.it seems that I have to put 2 of these ../../ like this src="../../image/fan.jpg"
well any ways its working for the images to show.
my eyes are closing a bit,but I still will do more on it.
tks.
johnny
 
I'm on my way to work but I took a few minutes to see how far you got last night and you seem to have gotten most of the links and images working so I don't think there is a problem with the spaces. The "Floors" link works but the images are still showing place holders. I'll guess that you gust haven't edited the path to those yet. Sorry for confusing you with the Alias thing. From one of your earlier posts I thought you wanted to give other websites access to your /images directory. At my old age I get a little confused from time to time. It seems like most of your issues come from how you write paths to files on your website. Apache is designed to run many virtual servers at the same time. That means one instance of apache can run hundreds or thousands of websites. Each of these websites is called a virtual server or virtual host (vhost for short). Each vhost lives in its own virtual reality. That is, its world begins at its DocumentRoot (htdocs directory). So then, if you type in your browser, you will be served a page in my DocumentRoot called the index. It is generally index.html or index.php but apache can be configured to use any file name. Now getting to how referencing paths work. To keep things short, I'll call the htdocs directory the "root" directory. Let's say insided you root directory you have two sub-directoies, images and electrical. Now if you want an image on your index page, the path would be:

images/mypic.jpg

Now let's say you have a file called electrical.html in the electrical directory. The path when called from index.html would be:

electrical/electrical.html

Now here seems to be where you are having problems. Let's say you want to call a file called light.jpg in the images directory from electrical/electrical.html. From this page you have to go up one level to the root directory then to the images directory. You do that like this:

../images/light.jpg

If you have to go up two levels you would use ../../ This method is used for larger websites that have several levels of directories where you need to reference things this way. If you only have directoies one or two levels deep, then you can use absolute addressing. Since your image directory is off the root directory the slash in front of a path means you are starting at the root directory, then you could call files in the image directory like this:

/images/light.jpg

Note that this is for calling a file from outside the root directory. If you used the slash from index.html then the path would be (note the double slash). I hope I'm not adding to the confusion but it seems like you are getting a pretty good grasp on things so I just wanted to give you a little background.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top