Jump to content
xisto Community
electriic ink

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

Recommended Posts

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.

 

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:

 

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

DirectoryIndex forum/index.php

Share this post


Link to post
Share on other sites

How to upload images to my simple website

How To: Change Your Website's Index File

 

Hi People,

 

I wondered if you could help me out here.

 

I have a simple website and have been trying to upload images to make my webpages look better. Problem is I load up the image but it just shows the space when I ftp it to my website.

 

Can you help?

 

Uwu

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

wow this is goodMy 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!

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites
My joomla site i need to change index.phpHow To: Change Your Website's Index File

My joomla site I need to change index.Php to home.Htm...

I'm going flash intro in my site after that its reach index.Php... So I'm using my flash file to index.Html... So it run fine but the problem is when I click in joomla home button its reach Intro page (index.Html) so can u guide me to solve this problem.. Very urgent...Please 

-reply by riyas

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.