Jump to content
xisto Community
electriic ink

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

Recommended Posts

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.

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!

In the file write the following:

 

DirectoryIndex best_design.weirdext

Replace best_design.weirdext with the file you want your index page to be.

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 :D. Any questions/comments regarding this tutorial :D

Share this post


Link to post
Share on other sites

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. :D

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

The only little problem is that all the index in your page will have another nameso if you have a forum it will cause some big problems.But is a good advice for thouse who wanted

Share this post


Link to post
Share on other sites

This is a very good tutorial. It is easy to read and easy to understand.The only problem is that at the moment, I don't have the need to change my website's index file. However, there's bound to be other users out there who do want to change the website's start page. This tutorial will certainly help. If anyone ever asks me how to do it, I will refer them to this topic.Thanks for sharing :lol:

Edited by sportytalk (see edit history)

Share this post


Link to post
Share on other sites

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!I don't think I'll really use it that much, though. It's just easier for me to use index.Does it automatically accept index.php over index.html? I haven't checked that yet. ;)

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.