homepage Welcome to WebmasterWorld Guest from 54.167.130.74
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
Server Side Includes - Paths, Directories
Paths, directory, SSI
chasmcg

5+ Year Member



 
Msg#: 3372554 posted 7:32 pm on Jun 19, 2007 (gmt 0)

On my server I have a directory and file located here that I want to access - /public_html/ads/728-468x90-60.txt

Index.shtml is in the public_html directory of my server. If I put a server side include in index.shtml that asks for a txt file from /public_html/ads, it will look like this....

<!--#include file="./ads/728-468x90-60.txt"-->

And it works great. Now........

I have another directory with a file in it located at /public_html/windows2003/start.htm. I want to put an SSI in start.htm and it will look like this....or so I thought...

<!--#include file="../ads/728-468x90-60.txt"-->
<!--#include file="/public_html/ads/728-468x90-60.txt"-->
<!--#include file="../../ads/728-468x90-60.txt"-->
<!--#include file="./ads/728-468x90-60.txt"-->
<!--#include file="/./ads/728-468x90-60.txt"-->

But none of these paths enable me to get the same file from /public_html/ads/. Plus I have tried many more. Does anyone know how to access this file from this location? Or know how to access directories with SSIs? Paths, to me, are strange with SSIs.

 

chasmcg

5+ Year Member



 
Msg#: 3372554 posted 10:02 pm on Jun 19, 2007 (gmt 0)

<!--#include file="../ads/728-468x90-60.txt"-->

It looks like using virtual (below) instead of file (above) will do the trick. I did a search on the forums and found the solution. I did a search before I posted but wasn't patient enough. The code below works.

<!--#include virtual="/ads/728-468x90-60.txt"-->

jdMorgan

WebmasterWorld Senior Member jdmorgan us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 3372554 posted 4:51 am on Jun 20, 2007 (gmt 0)

Glad you got it figured out -- "include virtual" is recommended for most applications.

Jim

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved