.htaccess Allow CSS in cgi-bin

Discussion in 'Apache' started by SleepingInChapel, Jan 5, 2009.

  1. #1
    I'm trying to set up a TWiki distribution at work, and everything works great except for one thing--the stylesheets. I've even typed in the correct path to where they should be in my web browser and instead of seeing the source code for the stylesheet, I get a completely blank page--no error--no nothin'.

    I've talked with my webhosting provider and a support person said that I "should only put scripts in the cgi-bin folder". I understand where he is coming from for security reasons, but if I follow that policy, I'll have to go through a lot of TWiki scripts and change the references for CSS files to some other place than the cgi-bin folder. :(

    I don't have access to the main configuration file so...

    Is there anyway to configure Apache with .htaccess files to allow CSS files to be executed?

    Like I said, everything else works, even the perl scripts--just not the CSS.
     
    SleepingInChapel, Jan 5, 2009 IP
  2. skinstc

    skinstc Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    If you can put your files only into cgi-bin, you can do thus.

    lets assume that your css file is styles.css

    rename it to styles.dat

    create perl script styles.css

    #!/usr/bin/perl

    open(data, "styles.dat");
    while(<data>) {print $_;}
    close(data);


    chmod +x styles.css

    now if your wiki call style.css file it will be executed and output will be styles from your styles.dat file.
     
    skinstc, Jan 15, 2009 IP