Change the default file the Directory sends! I need to send .js not index.html!!

Discussion in 'Site & Server Administration' started by Dollar, Jan 23, 2008.

  1. #1
    Okay does anyone know how to make a directory send a different kind of file?
    Here is my preliminary I need to send from /en_us/
    (this is folder) but the folder need to shoot out a .js (javascript) file not a index.


    Sooo.. Solution? :)
     
    Dollar, Jan 23, 2008 IP
  2. ade_dnb

    ade_dnb Peon

    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I believe that putting this into your .htaccess will do that for you(.htaccess in /en_us/ folder).

    DirectoryIndex filename.js
    Code (markup):
    I don't know much about this but that is what a google search brought up.

    http://forums.digitalpoint.com/showthread.php?t=56219
    Code (markup):
     
    ade_dnb, Jan 24, 2008 IP
  3. Krnl

    Krnl Peon

    Messages:
    60
    Likes Received:
    3
    Best Answers:
    1
    Trophy Points:
    0
    #3
    You'll probably want to leave index.html and index.php in there just in case there are subdirectories on your server that have them...so just add the .js file to your directory index:

    
    DirectoryIndex index.php index.html index.htm filename.js
    
    Code (markup):
    Well..now that I reread the post...use the above if you're adding it to httpd.conf (site-wide), otherwise, the addition to .htaccess in that particular directory should do the trick.
     
    Krnl, Jan 24, 2008 IP