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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding folders in hdoc's

Status
Not open for further replies.

conntaxman

Programmer
Aug 7, 2003
55
0
0
US
To add a folder or folders for will say Images,test pages, etc in the htdocs. would i just make the folder and insert the image [ARROW] and to Call it out just use the correct path like "c:/programfiles/apachegroup/apache2/htdocs/image/arrow"
tks
john
 
To avoid those long urls, you may want to use the Alias directive. The syntax is pretty simple. Let's say you have a directory with all your graphics called images. You would create an alias like this:

Code:
Alias /images/  /path/to/images

Now apache will pretend that the images directory is inside the DocumentRoot. To call an image the url would be:

Code:
[URL unfurl="true"]www.mydomain.com/images/myimage.jpg[/URL]

You will notice that apache already uses an Alias to the /icons directory. This means you can access this directory just as if it were within your DocumentRoot. The same goes for the apache manual. To check it out type and see what happens. The ScriptAlias directive does the same thing but tells apache to parse everything in that directory as a script. These directives come in handy when you want all your vhosts to share common resources such as scripts and graphics. Another way to avoid long urls is to use relative addressing. You don't need to start way back at the root directory. Apache assumes your /htdocs directory to be the root. That means you can use just "images/myimage.jpg" to do the same thing accomplished in the first example. All paths are relative to the calling script so if you are in another directory off the root, you would use "../images/myimage.jpg". I know this is more than what you were asking so to make a long story short and to answer your question, the answer is yes.
 
RhythmAce .Thank you very much for all your comments.
That helped me out alot.
have a nice day.
and THANK YOU again
Johnny
ps
Just a bunch of great people on these forums.
 
It seems that my images wont come up Except 1 and that one is in the same folder as the rest.I tried
<img src="../inage/name-of-image.gif">
<img src="I have apache running on IE / XP.
Links are doing the same wont come up.
But why would 1 image come up?
tks
John
 
Might need some hints from you error logs on this one. I know a lot of people who run apache on Windows seem to have more than their fair share of problems with graphics.



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top