[How to]Change the Directory Index

Những vấn đề cơ bản về PC, Net ... liên quan đến sinh hoạt thường nhật.

[How to]Change the Directory Index

Postby TTL » Wed Jan 02, 2008 12:21 pm

[How to]Change the Directory Index

Usually when you browse to http://www.yoursite.com/ the browser leads you to index.php because this is the default file where you get to when only pointing on directory/

If you wish to have portal.php or another files as your default you can easily manage it by creating a .htaccess file.

In order to create a .htaccess file take the following mesures:

1.Open the .htaccess file in your forum root with an editor like windows editor, notepad, wordpad etc.
(You may need to download the file and open it afterwards)

2.Enter the code below at the end:

Code: Select all
DirectoryIndex index.html

(you can replace index.html with whatever file you want, e.g. portal.php)

3. Save the file

4.Upload and overwrite the exisiting one
(if your editor creates a htaccess.txt - upload this one, delete the old .htaccess, and rename the htaccess.txt to .htaccess)

Now your directory index is the file you typed in.
User avatar
Posts: 332
Joined: Sun Oct 28, 2007 3:32 am

Return to Máy Điện Toán, Mạng Điện Tử

Who is online

Users browsing this forum: No registered users and 1 guest