Jūs esateŽurnalai / Ernestas Kardzys's blog / How to access "icons" directory of Apache installation?
How to access "icons" directory of Apache installation?
By default Windows Apache directory looks like that:
2009.09.08 21:31 <DIR> . 2009.09.08 21:31 <DIR> .. 2004.11.21 13:50 15.159 ABOUT_APACHE.txt 2009.09.08 21:27 <DIR> bin 2009.09.08 21:27 <DIR> cgi-bin 2009.08.06 02:33 102.237 CHANGES.txt 2009.09.08 21:27 <DIR> conf 2009.09.08 21:27 <DIR> error 2009.09.08 21:27 <DIR> htdocs 2009.09.08 21:27 <DIR> icons 2008.09.18 13:16 4.835 INSTALL.txt 2009.08.06 16:15 36.833 LICENSE.txt 2009.09.08 21:29 <DIR> logs 2009.09.08 21:27 <DIR> manual 2009.09.08 21:27 <DIR> modules 2009.08.06 16:15 1.323 NOTICE.txt 2008.10.15 08:22 1.650 README-win32.txt 2007.01.10 00:50 6.094 README.txtThe point is that I have a file index.html which is located in htdocs directory. The file index.html needs a file apache_pb.gif from icons directory. So, how can file htdocs/index.html access the file icons/apache_pb.gif? One way is to make a copy of icons directory and paste it into htdocs. But I did in other way. I edited the file httpd.conf and added the fallowing lines:
Alias /icons/ "C:/Program Files/Apache Software Foundation/Apache2.2/icons/" <Directory "C:/Program Files/Apache Software Foundation/Apache2.2/icons/"> Options Indexes MultiViews AllowOverride None Order allow,deny Allow from all </Directory>My index.html looks like that:
<html> <body> <img src="/icons/apache_pb.gif" alt="Apache Logo" /> </body> </html>It works! :)


It works if in httpd.conf is enabled alias support :)
Skelbti naują komentarą