Jul 3, 2009
Pages: 1, 2, 3

How To: Change Your Website's Index File - a simple trick using .htaccess

free web hosting

Read Latest Entries..: (Post #24) by gameratheart on Sep 28 2008, 02:01 AM.
Wow this is pretty useful! I don't know about you guys, but many of the websites I own use Forum, Wiki or similar software, or rely heavily on scripting; and sometimes I have to it all in a subdirectory despite the fact I have no other use for the main directory, because a file interferes with another's operation, or just to keep it structured. So I just write my own index.html page and make it redirect to the real page. This tutorial, however, is a much better method. It's so mu...
read more.
Read the FIRST post of this Topic. - Express your Opinion! Contribute Knowledge :-).

Open Discussion > MODERATED AREA > Tutorials

How To: Change Your Website's Index File - a simple trick using .htaccess

cmatcmextra
How To: Change Your Website's Index File
a simple trick using the .htaccess file

A simple tutorial which only involves editing one little file. Useful for those of us who have mime-typed extensions or who are creating lots of test design files and want an easy way to make the design they like best their default file.
  1. Create a file called .htaccess in the /public_html/ folder if you don't have it. I think one should be there already when you get your site so if it isn't you should create it anyway!
  2. In the file write the following:

    CODE
    DirectoryIndex best_design.weirdext

  3. Replace best_design.weirdext with the file you want your index page to be.
  4. Open your website and if all has worked well, you should have your customized index page.

All agreed it's a lot simpler than the mouseover tutorial a did tongue.gif. Any questions/comments regarding this tutorial smile.gif

 

 

 


Comment/Reply (w/o sign-up)

s2city
Cool. I didn't know you could do that... I thought it was just the way it was... index.html forever and for always. lol! Thanks for the tutorial, I think I'll use it since index.html lacks a sort of beauty. tongue.gif

Comment/Reply (w/o sign-up)

JimiHex
where did you find this? smile.gif
do you have some more tutorials like this one?

thank you biggrin.gif

Comment/Reply (w/o sign-up)

Adamrosso
Lol index.adamrules =D. Thanks for this tutorial. Me too never knew you could do this. anywho thanks for posting it =D

Comment/Reply (w/o sign-up)

delivi
Hey dude that was really great of you by sharing this wonderful Tip. This will be really very useful to all of us.

Comment/Reply (w/o sign-up)

electron
Hey thats a good one.

If you could help me out on one thing in .htaccess .
Do you know what does IgnoreIndex means.
I read it somewhere and I think so it could be used for this as well.

If you do let me know.
Thanks and have a good day

Comment/Reply (w/o sign-up)

tuddy
Although if you go playing around more you can seriously impair visitors access to your site. I suggest you create a backup of the one you already have (if any), then create a new one, then slowly intergate the old one back into the new one after research of each part.

Comment/Reply (w/o sign-up)

Dooga
Hey thanks! I didnt know you could actually do that...

Comment/Reply (w/o sign-up)

HMN
lol even the mods didnt know about this lol

Comment/Reply (w/o sign-up)

jlhaslip
Oh yes we did. Just had to find it.
Hope it does what you want it to.

Comment/Reply (w/o sign-up)

Latest Entries

gameratheart
Wow this is pretty useful! I don't know about you guys, but many of the websites I own use Forum, Wiki or similar software, or rely heavily on scripting; and sometimes I have to it all in a subdirectory despite the fact I have no other use for the main directory, because a file interferes with another's operation, or just to keep it structured. So I just write my own index.html page and make it redirect to the real page. This tutorial, however, is a much better method. It's so much simpler and much more friendlier to search engines. Thanks, electriic ink!

Comment/Reply (w/o sign-up)

innosia
wow this is good
My method previously is using javascript to redirect the main file for example index.php to another file like home.php, but I happen to worry about how search engine will treat my site later on, so I decide not to do it after a while. Your htaccess technique is a good implement it since the search engine will come to this site instead. Good!

Comment/Reply (w/o sign-up)

Nabb
Use the other file manager? xD

Comment/Reply (w/o sign-up)

-Sky-
Thank you for this. But I cannot find .htaccess or any hidden files because I clicked automatically go to the File Manage, on v3. How do I get all the hidden files to be displayed?

Comment/Reply (w/o sign-up)

Deviatore
thanks for the tutorial.
i mistakenly didnt rename my homepage to index and then it started me irritating. i couldnt go back and fix all the links cos my website was a very big once containing more than 100 pages. so i had to make a new page having only "ENTER SITE" to be used as my homepage

Comment/Reply (w/o sign-up)



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)

Pages: 1, 2, 3
Similar Topics

Keywords : change, websites, index, file, simple, trick, htaccess

  1. Rfi (remote File Inclusion) What Is It? How Do I Stop It?
    Another website security tutorial (0)
  2. How To Create Pdf Files Using Free Tool
    Introduction to use a free tool to create PDF file (10)
    Now, that you don't need to have expensive software like Acrobat to create PDF. All you need is
    Microsoft Office and a software name doPDF. You can download the freeware from
    http://www.dopdf.com/download.php After downloading dopdf.exe, follow the instruction below 1.
    Double click to install it, as display at image 1.jpg, choose a language and click OK 2. You will
    see 2.jpg click next 3. Click I accept the agreement see 3.jpg, click next 4. Now you will see
    4.jpg, select the folder to install it and click next 5. When seeing 5.jpg, This is the folder group
    in Star....
  3. How To Extract The Audio From Youtube Videos
    get an mp3 file from youtube (6)
    How To Extract The Audio From YouTube Videos This lovely simple tutorial will tell you how
    to extract the audio from YouTube videos. Obviously , I am not in any way advocating that you take
    copyrighted music that is available illegally in video-form on YouTube and extract the audio from
    those videos rather than going down to HMV and buying the music. In this tutorial I will be using
    the following video: http://uk.youtube.com/watch?v=gUhhRc5eWNw Firstly, you download the video,
    which is simple. Just go to www.downloadyoutubevideos.com and paste the video....
  4. Debug Exe Files
    How to debug an exe file. (4)
    Think that we have written a program, and some codes are wrong. We can go back to compiler and
    change the code, and compile again. But I will show you how to correct our mistakes without using
    the compiler. Let's start: I have written a program in Delphi. Let's see my mistake. I
    have created a form like this. After this I wrote the codes in the Compare Button click as
    below. CODE 1.   procedure TForm1.ComparebuttonClick(Sender: TObject); 2.   var 3.    
    a,b:integer; 4.   begin 5.     a := StrToInt(EditA.Text); 6.     b := StrToInt(EditB.Text); 7. 8.  ....
  5. Make A Moderately-secure Password System Using Javascript
    using file redirection to hide the password. (11)
    JavaScript is very handy at making forms, allowing for much more customization and easier ways to
    send data. So making Login forms using JavaScript may seem to many to be a very feasable idea.
    However, JavaScript is very bad at protecting Passwords, as since the passwords are not encypted and
    the whole JavaScript code is in the page, a person could just view the Page Source and find out
    everything. Even if you use an external JavaScript, it would still be poor as the file name for the
    external JavaScript would still be revealed. But I have an answer! There is a relative....
  6. Install An Aef Forum Onto The Trap17
    From a zip file (11)
    Installing an AEF Forum on the Trap17 Server Preparation for Installing the AEF Forum
    The following items are required for the installation of the packaage onto your site: 1. - a copy
    of the AEF Forum zip package from http://anelectron.com/download.php 2. - a MySql Database 3. - a
    Database User 4. - a password for the Database User 5. - Privileges allowed for the Database User
    The details for ensuring that you have all of these items are as follows: 1. - a copy of the AEF
    Forum zip package from http://anelectron.com/download.php . Simply browse to t....
  7. Dynamic Signature - Yet Another Way To Do It
    Create dynamic sigs for multiple users using .htaccess and RewriteRule (0)
    Ever since I connected a program I made in Visual Basic to MySQL database, I had an idea to create
    some sort of a status page... And I did that, where I updated my connection status every 60 seconds,
    updated my Winamp playlist, and several other interesting things... Then, I figured I could create
    an image, and display all that info, and show it on forums, as a signature... And I made a great
    PHP script, that look real fancy, and does the job perfectly... So, I was adding the reference to
    http://status.galahad.trap17.com/stat.php to all the forums... BUT (there's ....
  8. How To Make A Simple File Based Shoutbox Using Php And Html
    (8)
    A simple tut to make a simple shoutbox. Let me jump right in. First of all you need the standard
    equipment for PHP, an IDE like XAMPP and an editor like PHP EDITOR 2OO7. Were going to make a
    simple guestbook using three files, webpage.php, shout.php and shout.txt. Webpage.php can be
    changed to whatver you want, it will be the page on which the guestbok is shown, you could even use
    this code and add it to another php page n your site. Shout.php is the proccessing page and
    shout.txt is where the shouts are stored. Firstly we need to make the visual design of the box.....
  9. Flat-file Cms
    tutorial inspired by jlhaslip (4)
    Ok, for this tutorial i am only going to show you how to add updates to your site simply by storing
    the information into a text file, and then displaying it with predefined formatting... OK lets get
    down to business... Lets start out by making a PHP file and call it mycms.php put this code at
    the top of the page. What this will do is allow us to edit the selected update when it comes time
    and show and hide the add an update field and validate the form.. function ShowHide(id1,
    id2) { if (id1 != '') expMenu(id1); if (id2 != '') expMenu(i....
  10. Using The Rewriterule
    .htaccess (0)
    Quick into on .htaccess .htaccess (note the dot) is a text file, each command is meant to
    be placed on a single line, so if your text editor has word-wrap, make sure it is turned off. When
    you upload it to your server, make sure it is uploaded in ASCII mode rather than binary. What
    is mod_rewrite? mod_rewrite is a apache modal that allows you to rewrite URLs at a server
    level. For example, when a user requests the page http://www.domain.com/index/disks/
    mod_rewrite could rewrite the URL so that the sever really gives this page http://www.domain.....
  11. Dynamic Signatures - The Real Way To Go
    Forget placing index.php in a signature.png folder. (8)
    This is only a very quick tutorial, meant to complement the dynamic signature tutorials that already
    exist here. It's nothing new, but it was just brought to my attention that not many people seem
    to be aware of this method. This does not cover the actual creation of dynamic signatures, per se -
    but rather a better 'trick' to allow you to use dynamic signatures on forums such as this
    one. I've noticed that most of the dynamic signature tutorials on this forum state that you
    must place a file index.php in a folder .png, in order to trick Invision Power....
  12. *nix File Permissions - An Overview
    (6)
    I was originally going to post this in a reply, but felt it would deviate from the topic.
    Here's a brief overview of the three numbers in a permission "code": -The first number is for
    the owner of the file. If you set a file at 600, the owner will have read and write access and
    everyone else is locked out. -The second number is for the users group (users are placed into groups
    to get special rights sometimes). Generally you will not give write access to a user's group.
    -The third number is for the rest of the world, including web users. Setting any value that wi....
  13. Starting Or Stopping Apache And Mysql Server Via Batch File
    (0)
    Hi guys, this is a litte tutorial about how we start and stop the Apache and MySQL in Windows NT
    (2000, XP, 2003) via a batch file script. As we know in Windows NT based system Apache and MySQL
    installed as Windows Services. So we can stop and start it using NET command. For more information
    about DOS command, type HELP at command prompt. I assuming that your MySQL service name is "mysql"
    and your Apache (Apache 2.0.x) service name is "apache2". If you want to chek it click Start > Run >
    services.msc > OK. Windows IS NOT Case Sensitive. Let's get started!. 1. Open....
  14. How To Fix Codecs And Movie File Problems
    ...a short but very useful tutorial (0)
    How to Fix Codecs and Movie File Problems For all of you who are having trouble with
    codecs, either not being able to play a movie you've downloaded or not having any
    sound/picture, this guide should help you. The Easy Quick-Fix Method For the lazy people
    amoung you who want the simplest possible solution, may I present Video LAN Player (VLC) ,
    it's a good video/audio player and comes with all the codecs you will need and has many
    features making it my player of choice. The (New) Other Method The Combined Community Codec
    Pack (C....
  15. Memory Trick To Speedup Windows Xp
    (28)
    Here is one of the not so known method for free-up the RAM to make the Windows run faster. When
    programs run in Windows XP, they frequently use what are called DLLs (Dynamic-Link Libraries). These
    contain shared programming instructions and other files like icons, graphics, sounds, etc. that
    different applications use in order to run. DLLs are stored in RAM whenever the applications load
    them; when you quit a program, XP is supposed to release the DLL from memory. But some DLLs can get
    stuck. Here is the method to mend this up. Step 1: You can force Windows XP to re....
  16. The Many Ways To Bypas File Hosting Annoyances
    (5)
    I've done a lot of research on this subject because it is much more common for people to upload
    files using file hosting services such as megaupload and rapidshare. They continue to try to push on
    their premium accounts on to the daily users who don't really want to put up any money for
    downloading which should be free.So i've compiled a few techniques I've used to bypass the
    limits of free downloading accounts and leave you feeling just as content with yourself as if you
    had a premium account. Download Managers: Now with the prominent use of file hosts ....
  17. Unencrypted But Invisible File Storage
    It can have a password, it can be unlocked. (0)
    This method works, but unfortunately compression software can open the file without the password.
    Also, you can try creating a new user account. When it asks "Make files and folders private?" click
    Yes, make private. Name the new user account anything using NO spaces/uppercase letters, but not
    something like "privatefiles" or something like that. Try accessing the files in C:\Documents and
    Settings\ >. You cannot open the folder. Now to ensure that user is always hidden in My Computer,
    click Start > Run. 1. Type in command.com . This should bring up a black window t....
  18. Using A Secure File Transfer Client
    A discussion of FTP, FTPS, SCP, and SFTP (0)
    Using a Secure File Transfer Client Almost everyone who creates a web site is faced with
    the problem of getting their files from their local computer to their web server. There are a few
    different protocols (methods) through which to accomplish this, and some have definite advantages
    over others. Here are the major ones, listed loosely in order of increasing security. Note: All
    of the programs recommended in this tutorial are for Windows only. Command line alternatives are
    accessible via the terminal for both Linux and OS X. FTP First a note on using ....
  19. How To: Make A Simple Php Site
    Making one file show up on all pages using php (21)
    I have looked all over the site and could not find anything that was like this simple, or just like
    this at all.. For some people i know that you are using a basic HTML site...and having a big menu
    if you want to add somthing you have to go into every one of the pages and add or remove or edit
    what you want to do, but with somthing verry simple all you would have to do is edit one file, and
    all of the pages that have the PHP script on them would suddenly change to what that one file is.
    So to start off if you are planning on using this little tirck, the page that you a....
  20. Transfer File Of Any Size Using Winsock Control
    Winsock Help (5)
    This tutorial shows how to transfer file of any size using winsock control. - Open VB; - Select
    standard exe; - Press Ctrl + t to show the add component window; - Select winsock control and
    microsoft common dialog; - Add one winsock control in the project; - Name it winsock1; - If you want
    to add chat then add another winsock and name it winsock2; - Insert another winsock object if you
    want to add chat also; - Add a microsoft common dialog box; - Name it cd; - We will use this
    winsock1 object to transfer the file and winsock2 for chat; ------------- The basic idea : ....
  21. Networking Tutorial: File And Printer Sharing
    A basic computer networking tutorial (0)
    Network Setup: Newbie Install Click start, then right click computer Ensure that the full
    computer name is memorable and that each machine is on the same workgroup. After you've done
    this, you are ready to configure advanced features, such as file and printer sharing. Adding a
    Printer Locally Firstly, you need to configure your printer (on the machine which is
    directly connected to the printer) for printer sharing. Click start, control panel,
    printers/scanners, then right click on your local printer and click 'properties'. Browse to
    the shari....
  22. Dos 6.22 Trick With Ramdrive
    Make a legacy app not need a hard drive (0)
    This is partly fun, partly to record how I got around an annoying restriction with a particular
    piece of software we use to control door locks. This software must run on DOS 6.22, not Windows 98
    command line, not in a DOS window, but native DOS. Very particular. I had been installing DOS 6.22
    onto a spare laptop, loading the software and then our data, running the program, backing up the
    data, wiping the laptop's drive, and restoring our standard Win2K setup via ghost. That worked,
    but it killed a couple of hours every time I had to run that program, and I wasn'....
  23. How To Edit Your "index Page"
    Adding new pages? (0)
    This tutorial was requested by sxyloverboy . Introduction: sxyloverboy has asked me how
    to make your navigation bar on him website change to add another page, without having to do it on
    every page. Well, I have the answer for you! Beginning Assuming you have a FTP upload access,
    you'll be open your file "index.php" -=Example=- Once your "index.php" file is open press
    "CRTL+F" (Find) and search for something that looks like this; CODE                        
                                                 width="100%" height="14" valign="top"....
  24. Css Trick: Hide Disabled Internet Explorer Vertical Scrollbar
    (26)
    I'm working on a website and a few minutes ago I got very tired from the Internet Explorer
    vertical scrollbar. This vertical scrollbar is always there, even if the length of the page does not
    require a vertical scrollbar. In this case, Internet Explorer will disable the scrollbar though not
    remove it. In my opinion this would be correct behaviour. The disabled however not hidden scrollbar
    means that a switch between a preview of your website in Mozilla Firefox and MS Internet Explorer
    will lead to an annoying change of the location of your layout. To disable this an....
  25. Shut Down, Restart, Log Off Xp Using A Batch File
    Undocumented feature for XP (0)
    This is a copy of a tutorial I created for astahost.com. I'm copying it here as a courtesy to
    trap17 members. /smile.gif' border='0' style='vertical-align:middle' alt='smile.gif' /> QUOTE
    How to shutdown a XP Pro computer when you are connected using RDC (Remote Desktop Connection)
    using a batch file or RPC (Remote Procedure Command) This is useful if you can't get to the
    computer but have remote access to the computer via a network or the internet. First To show you
    what you will see at a command prompt (command.com) when you type: "shutdown /?" Wit....

    1. Looking for change, websites, index, file, simple, trick, htaccess
Similar
Rfi (remote File Inclusion) What Is It? How Do I Stop It? - Another website security tutorial
How To Create Pdf Files Using Free Tool - Introduction to use a free tool to create PDF file
How To Extract The Audio From Youtube Videos - get an mp3 file from youtube
Debug Exe Files - How to debug an exe file.
Make A Moderately-secure Password System Using Javascript - using file redirection to hide the password.
Install An Aef Forum Onto The Trap17 - From a zip file
Dynamic Signature - Yet Another Way To Do It - Create dynamic sigs for multiple users using .htaccess and RewriteRule
How To Make A Simple File Based Shoutbox Using Php And Html
Flat-file Cms - tutorial inspired by jlhaslip
Using The Rewriterule - .htaccess
Dynamic Signatures - The Real Way To Go - Forget placing index.php in a signature.png folder.
*nix File Permissions - An Overview
Starting Or Stopping Apache And Mysql Server Via Batch File
How To Fix Codecs And Movie File Problems - ...a short but very useful tutorial
Memory Trick To Speedup Windows Xp
The Many Ways To Bypas File Hosting Annoyances
Unencrypted But Invisible File Storage - It can have a password, it can be unlocked.
Using A Secure File Transfer Client - A discussion of FTP, FTPS, SCP, and SFTP
How To: Make A Simple Php Site - Making one file show up on all pages using php
Transfer File Of Any Size Using Winsock Control - Winsock Help
Networking Tutorial: File And Printer Sharing - A basic computer networking tutorial
Dos 6.22 Trick With Ramdrive - Make a legacy app not need a hard drive
How To Edit Your "index Page" - Adding new pages?
Css Trick: Hide Disabled Internet Explorer Vertical Scrollbar
Shut Down, Restart, Log Off Xp Using A Batch File - Undocumented feature for XP

Searching Video's for change, websites, index, file, simple, trick, htaccess
See Also,
advertisement


How To: Change Your Website's Index File - a simple trick using .htaccess

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com