Jul 25, 2008

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

Free Web Hosting, No Ads > CONTRIBUTE > Tutorials
Pages: 1, 2

free web hosting

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

electriic ink
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

 

 

 


Reply

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

Reply

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

thank you biggrin.gif

Reply

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

Reply

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

Reply

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

Reply

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.

Reply

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

Reply

HMN
lol even the mods didnt know about this lol

Reply

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

Reply

Latest Entries

shomazta
could I possibly set it up to go to another directories index page?? say for instance I have a forum but I haven't coded the "main" site yet so I went and installed the forum in a directory called /forum

could I have it do
CODE
DirectoryIndex forum/index.php

Reply

Striker9099
VERY nice! I was actually wondering how to change my current index file on my new website... I've always used CMS's in building my websites... this time I want to try something different, so this tutorial is definitely helpful since I actually didn't know how to do it... thanks again buddy, keep it up smile.gif

Reply

Forbez
Good tut, but I don't understand why you would eed to change it for.
Good work anyways.

Reply

electriic ink
QUOTE(hippiman)
Do you need to add a .htaccess file to every directory, or just the ones that you're changing from index, or does it change the index file for all your directories? If it did it for every directory in the directory, unless you told it otherwise, that'd be great!


Unless separate .htaccess files are in the subdirectories with this code in, this will work for the directory the file is in and all subdirectories.

QUOTE(hippiman)
Does it automatically accept index.php over index.html? I haven't checked that yet


I don't know but you can set it so the server looks for index pages in a different order:

CODE
DirectoryIndex index.php index.html


Now the server looks for index.php to show as the default index page; if it can't find index.php, it looks for index.html, which it displays as the default index page. If neither are found, the 404 error page is shown.




Reply

Imtay22
so if i use your code, can I make it in a different directory, like direc/index.php ? can You do that? I will try it. Thanks for finding this!

Reply



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*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Pages: 1, 2
Recent Queries:-
  1. index file from website - 1.17 hr back. (1)
  2. how to create htaccess file in windows 98 - 8.68 hr back. (1)
  3. file type for index of website - 16.65 hr back. (1)
  4. changing index htaccess - 22.98 hr back. (1)
  5. website index file - 25.52 hr back. (1)
  6. change index file with htaccess - 20.70 hr back. (2)
  7. how to open a id2 file - 36.65 hr back. (1)
  8. what is index file on website - 42.38 hr back. (1)
  9. index file .htaccess - 44.07 hr back. (1)
  10. how to change default file website - 44.68 hr back. (1)
  11. how to change the index website - 50.13 hr back. (1)
  12. change the file of my website - 51.79 hr back. (1)
  13. htaccess index file - 3.73 hr back. (5)
  14. .htaccess index file - 44.50 hr back. (2)
Similar Topics

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

  1. Debug Exe Files
    How to debug an exe file. (4)
  2. How To Download Youtube Videos
    without softwares or websites (23)
    With this how to you'll find out how to download videos from youtube without using any software
    or website. 1. Retrieve the id video from the link (the code after ‘v=’) example:
    http://www.youtube.com/watch?v=muP9eH2p2PI => muP9eH2p2PI 2. In your favourite browser go to
    http://youtube.com/v/{ID video} example: http://youtube.com/v/muP9eH2p2PI 3. Link in the address
    bar will change. Replace ’swf/l.swf’ with ‘get_video’ and press Enter 4.
    Save your file /biggrin.gif" style="vertical-align:middle" emoid=":D" border="0" alt="bi....
  3. Make A Moderately-secure Password System Using Javascript
    using file redirection to hide the password. (4)
    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 rela....
  4. How Can I Create Websites With Free Software?
    A challenge given to me by David of Essex (not David Essex) (16)
    OK I've done it! made a selection of tutorials and programs I'm Going to be making a CD
    with all this on if anyone is interested... So The Challenge! To Find Open Source/Free
    software and build a website with it Flash NO Javascript YES HTML YES PHP YES The Software
    KompoZer in the end its the best! it has ftp WYSIWYG and Raw code editing so its satisfying
    everyone /smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />
    FTPcommander is brilliant! GIMP An excellent image editing program and as alw....
  5. Creating Navigation For Html Websites
    Have a common navigation menu for the whole website! (12)
    Pre-requisite: HTML, inline frame tags 1 Attachment(.zip) included. Updates : 29-12-07: Doctype
    added in example files (Advised by jlhaslip) Designing a whole website takes a lot of planning
    and organization. Designing a proper navigation system is a basic step in building your website. If
    you are developing webpages in html you would have observed that as you go on creating pages it
    becomes difficult to maintain the links to the pages. This article will guide you in developing a
    common navigation menu for your website. It describes three ways, so if you don'....
  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.. <script
    language="javascript"> function ShowHide(id1, id2) { if (id1 != '') expMenu(id1)....
  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. ....
  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 blac....
  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                
     <tr>                                <td class="off" onmouseover=....
  24. Css Trick: Hide Disabled Internet Explorer Vertical Scrollbar
    (18)
    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

Searching Video's for change, websites, index, file, simple, trick, htaccess
Similar
Debug Exe
Files - How
to debug an
exe file.
How To
Download
Youtube
Videos -
without
softwares or
websites
Make A
Moderately-s
ecure
Password
System Using
Javascript -
using file
redirection
to hide the
password.
How Can I
Create
Websites
With Free
Software? -
A challenge
given to me
by David of
Essex (not
David Essex)
Creating
Navigation
For Html
Websites -
Have a
common
navigation
menu for the
whole
website!
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.pn
g 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
advertisement



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



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE