SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Evangelist CyberFuture's Avatar
    Join Date
    May 2001
    Location
    San Diego, CA
    Posts
    434
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Changing File Type Order in .htaccess

    Hi,

    I not sure I'm using the right terminology, but basically what I want to do is if a browser goes to www.domain-name.com and the site contains two web pages: index.html and index.php, I want to be able to control which file Apache shows. I remember that there was someplace in the configuration file that you set the file type order, but I can't find it. Please Help!

    Thanks, Sandra

  2. #2
    SitePoint Member
    Join Date
    Jul 2005
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sandra,

    This line in your .htaccess file should do the trick:

    DirectoryIndex index.php index.html index.htm index.shtml

    This order will have Apache look for index.php first followed by .html, .htm then .shtml.

    You can also use this line to change the name of the file Apache looks for too. If you do not wish to use index you could try something like default.html, first.html, etc.

  3. #3
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,680
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)
    d3web,

    Good (correct) answer! Thanks!

    ... and WELCOME to SitePoint's Apache Forum!

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  4. #4
    SitePoint Evangelist CyberFuture's Avatar
    Join Date
    May 2001
    Location
    San Diego, CA
    Posts
    434
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks d3web


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •