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

Image & Style Sheet subdirectories of a CGI Directory 1

Status
Not open for further replies.

NigeW

Programmer
Jun 10, 2002
134
NZ
I am building a content management "backend" for a site.

I have defined a CGI directory of BACKEND (how original !)

Under that directory I want to have sub-diretories for stylesheets, scripts, images, etc.

I have discovered that the images are not diplaying and the styles are not being applied to the page.

The obvious simple solution is to load these outside of the CGI directory, but I was wanting to keep the backend nicely packaged together, rather than have data all over the site.

Any feedback would be appreciated.

Thanks

Nigel Wilson
"kiwi-kid"
 
If you're using a hosting company, you don't normally have access to directories outside of your htdocs/ other than your cgi directory. You would put your &quot;backend&quot; directory in the same directory that holds your HTML pages. However, to help with your problem, you'll have to provide the exact path to your backend files in your CGI scripts: <img src=&quot;
There's always a better way. The fun is trying to find it!
 
Nigel,
Even if you're not using a hosting company, if you're using apache, it can be configurted to be very strict on the MIME types it serves from the CGI-BIN directory. Had this problem with images in the past, and was stumped for a good while on it

HTH
--Paul
 
Hi Paul

Through the control panel for my site I can add mime types.

I will try adding .jpg, .gif and .css as mime types and see if this sorts the problem.

Thanks for pointing me in the right direction - big ups to you my man !!!

Nigel Wilson
&quot;kiwi-kid&quot;
 
Generally /cgi-bin/ is ScriptAlias-ed in Apache, and it tries to execute everything in it as a script, including images and style sheets linked from CGI-generated pages. Are you getting errors in your log from each time an image or style sheet is accessed? I'm not sure if altering mime types gets around ScriptAlias never sending content out plain, only execute and send output. It's really a security thing, so no script could ever get sent out plain text. I normally have different directories for all the different file types:


Most of the time, I try to put completely different projects on different subdomains, so I can have that directory structure for each project. If putting multiple projects onto one site, I'd just make a 'project-name' subdir in each of the above to store files for it.

Just a few belated thoughts. Best of luck.

________________________________________
Andrew - Perl Monkey
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top