Different Directory Index Page

Normally index.html or index.php is the default page a server serves up when visiting a directory without specifying a file name. You can change this with .htaccess:

DirectoryIndex index2.html

Comments

  1. User Avatar
    bob
    Permalink to comment#

    that’s cool.

  2. User Avatar
    Gvidas
    Permalink to comment#

    How to write in htaccess if i dont wanna show index.php file if u pressing on home button,or dont wanna sho any files in the end,just folders..For example :
    —————————————–
    before

    myweb.com/index.php

    after

    myweb.com/

    ———————————————–
    before

    myweb.com/profile/home.php

    after

    myweb.com/profile/

  3. User Avatar
    JBeast
    Permalink to comment#

    I’m totally new to .htaccess. I never thought that this thing is possible. Thanks! Keep it up!

Posting Code

You may write comments in Markdown. This makes code easy to post, as you can write inline code like `<div>this</div>` or multiline blocks of code in triple backtick fences (```) with double new lines before and after.

Code of Conduct

Absolutely anyone is welcome to submit a comment here. But not all comments will be posted. Think of it like writing a letter to the editor. All submitted comments will be read, but not all published. Published comments will be on-topic, helpful, and further the discussion or debate.

Want to tell us something privately?

Feel free to use our contact form. That's a great place to let us know about typos or anything off-topic.

Submit a Comment

icon-closeicon-emailicon-linkicon-menuicon-searchicon-tag