The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Prioritizing index file types

Discussion in 'General Discussion' started by wyrmmage, Mar 19, 2008.

  1. wyrmmage

    wyrmmage Registered

    Joined:
    Mar 19, 2008
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Hello everyone; it's my first post here, and I searched the forums, but didn't see anything relevant, so please forgive the newbish question :)
    I have a webserver using CPanel 11. I have a directory containing files named index.css, index.html, index.php, and index.js . I need to prioritize which file is looked for first, because the webserver looks for .php files before .html and .css (which is what I want), but for some reason it displays .js files over .php files :\
    This means that whenever users view my site, they automatically see the index.js page, unless they manually type in /index.php, which obviously no one does.
    How would I go about fixing this? I know there was a way you could do it in version 9, but I can't find it in version 11 :(

    Thanks in advance :)
    -wyrmmage
     
  2. libin

    libin Member

    Joined:
    Jul 4, 2006
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    We can change the order of precedence, enter a DirectoryIndex command with multiple file names on the same line in the .htaccess file on that directory. The order in which the file names are listed (from left to right) determines the order of precedence. For example,

    DirectoryIndex index.cs index.cgi index.php index.js


    Hope this helped you.
     
    #2 libin, Mar 19, 2008
    Last edited: Mar 19, 2008
  3. wyrmmage

    wyrmmage Registered

    Joined:
    Mar 19, 2008
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    perfect!
    Works beautifully ^_^

    Thank you :)
    -wyrmmage
     
Loading...

Share This Page