Link to home
Start Free TrialLog in
Avatar of chinamotion
chinamotion

asked on

cgi-bin question

I am a new programmer to do cgi/ perl
Should my cgi and perl must be placed in cgi-bin

how to point to the right directory, if all related sub-directory in the same level
main_dir -----cgi-bin
         ----- images
         ----- html
If some path , such as  .\.\ abc.gif  is not workable in linux and unix, but workable in NT.
How to point to the right directory in Linux or unix ?

Avatar of Chris S
Chris S
Flag of India image

use always / for path info

normally cgi scripts can be placed in any directory
Avatar of chinamotion
chinamotion

ASKER

Sorry, I make some error in my question.

The actual question info is that:
If some path , such as  ././images/ abc.gif  is not workable in linux and unix, but workable in NT.


How to point to the right directory in Linux or unix for upper, upper level?
if cgi-bin,images and html sub-directory in the same level.
ASKER CERTIFIED SOLUTION
Avatar of Chris S
Chris S
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
In Unix/Linux, it is ../ to go to the upper level. (e.g ../cgi-bin/script.pl).

NOT ./
zxv250 is correct ./ means "from here", wherever "here" is!

If you are using Apache look at the directives in the conf file (there is a lot of comment explaining how it works) and also consider using rewrite rules. I do the latter to implement a virtual file store.