Jump to content

referencing sub-dirs of htdocs


pi_1

Recommended Posts

I have a problem referencing sub-dirs of htdocs in my html code.

 

This works fine:

src="images/pic.gif"

 

But This fails:

src="/images/pic.gif"

 

Unfortunately I have a lot of existing code which uses the second example's format (with the preceding slash). I need to configure my WAMP to work with this format.

 

I am installing WAMP to match the php + mysql versions on an existing web server. So I cannot change versions of php nor mysql. I am using:

Apache 1.3.37

PHP 4.46

MySQL 4.1.22

 

  • Can I configure Apache to work with this format: src="/images/pic.gif" ?
  • Or would another version of Apache work?

 

Thanks

Phil

Link to comment
https://forums.phpfreaks.com/topic/58821-referencing-sub-dirs-of-htdocs/
Share on other sites

That should work fine. When you have / at the beginning of a file path it means root. / should tell Apache to request the file 'images/pic.gif' from the document root.

 

There may be a configuration issue or Apache1.3.x doesn't support it. I'm not sure I'll have a look at the Apache documentation.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.