InMotion Hosting Support Center

The server looks for specifically named files as the first page of your website, also known as the index page. The default order of index file names our particular servers look through is index.htm, index.html, index.php, and finally default.htm. You can change the name of the index file your account looks for by altering the .htaccess file. Perhaps you want to have a specific custom name for your index file or maybe you are migrating from another host and the index page is named differently. This way your internal links will not be broken by renaming the index file.

What is an htacces file?

The .htaccess file is a hidden text file within your hosting account that can be very powerful. It is designed so that you can modify it to change the behavior of your website that normally would take higher access beyond your account. It acts as a liaison between your domain and the server and can perform many functions.
Learn more about htaccess

Changing your default index file via htaccess

  1. First, you will need to log into your cPanel to access the htaccess file.
  2. Find the Files category and click on the File Manager icon.
    cpanel
  3. A popup box will appear. For the primary domain, click on the Web Root radio button. For addon domains, click on the dropdown and find your desired addon domain name. Be sure the checkbox next to Show Hidden Files is checked. Click the Go button to enter the File Manager.
    file-manager-show-hidden
  4. You should now be in the root folder of the domain you chose. Look for the .htaccess file and right click on it. This brings up a menu. Find and click on the Edit option. If you get a popup box, simply find and click the Edit button in the lower right corner to continue to the editor.
    file-manager-htaccess
  5. You are now in the htaccess editor. Paste the following code at the top of the page to configure your desired index page. In our example below, we decided to make the index page of our folders named first.html.
    #Alternate default index page
    DirectoryIndex first.html
    You can also list more than one file in the configuration. The file will be read left to right and check for them in that order. In this example, we add index.htm, index.html, and index.php to the list. First the server will check for first.html, if it does not find a file with that name, it continues to index.htm and so on.
    #Alternate default index pages
    DirectoryIndex first.html index.htm index.html index.php
  6. Be sure to hit the Save Changes button in the upper right corner to save your new htaccess configuration.

Support Center Login

Social Media Login

   
Social Login Joomla

Related Questions

Here are a few questions related to this article that our customers have asked:
forbid users from browsing web directories
Redirecting Directory to File! How?
Would you like to ask a question about this page? If so, click the button below!
Ask a Question
n/a Points
2014-03-03 8:01 am

Wonderful

n/a Points
2014-03-05 12:05 pm

Thanks

n/a Points
2014-06-12 1:11 am

thanks, very useful

n/a Points
2014-07-09 5:20 am
Thanks. Just what I was looking for.
n/a Points
2014-07-14 11:07 am

THANK YOU!!!

n/a Points
2014-07-23 1:20 pm
It is excellent as it is.
n/a Points
2014-09-08 1:45 pm
this is the simple & best method that anybody can understand.just keep it SIMPLE..all the very best.
n/a Points
2014-09-11 11:24 am

Didnt worked for me.

 

getting 

Not Found

The requested URL was not found on this server.

Staff
11,186 Points
2014-09-11 12:16 pm
Be sure that the file name as well as the extension that you are referencing within your .htaccess file are exactly as they are on the server.
n/a Points
2014-09-12 3:05 am

Thanks. I checked and all seems correct. Tried uploading Joomla also and still its not picking default page. So called the hosting support line and they admit that theres a fault at there end and they will fix it by eveving. Lets hope they fix it soon and then will try agin. Thanks for your replies.

n/a Points
2014-10-13 2:15 am

does this mean i can edit the html file coz i dont want to edit the style.css coz am not yet good with css but html.

Staff
17,887 Points
2014-10-13 8:44 am
Hello arthur,

Thank you for contacting us today. This guide allows you to set which file will load when someone visits your website. For example, you can set it to load any of the following files: index.php, index.html, index.htm

There are several ways to Edit Files, which are covered in our guide How do I edit a file on my server?

If you have any further questions, feel free to post them below.

Thank you,
John-Paul
n/a Points
2014-10-17 9:13 pm

Its the same way to add a new index?

Staff
17,887 Points
2014-10-19 9:23 pm
Hello Joe,

Thank you for contacting us. I am not exactly sure what you are asking, but this guide lets you set which file will load when someone visits your website.

Thanks,
John-Paul
n/a Points
2014-11-26 12:03 pm

Hello ,

i have some problem that may be ralated to this issue, i have changed the Directory Index for magento store since 4 months and it was working very well tell yesterday because of some one of the store managers have did some changes to the website configuration and it now it gave me "There was no Home CMS page configured or found." and i don't know what to do , i searched many time so please if you can help as my experience with Magento is something little.

thanks

Staff
17,887 Points
2014-11-26 12:21 pm
Hello Hamada,

Thank you for contacting us regarding Magento. First, make sure you have the Magento Home page setup correctly in the Dashboard.

Also, make sure your Store View is enabled, this should allow it to display.

Thank you,
John-Paul
n/a Points
2014-11-27 4:21 am

Thanks John for your fast reply,

i have ensured that all settings of the homepage and the stores views asre set correctly, any other help?

Thanks

Staff
26,266 Points
2014-11-28 11:47 am
Hello Hamada,

If your settings are correct and they're not working when they once were, then you may need to contact Magento support for further assistance. It appears as the issue is more Magento oriented at this point and this may be something that they are required to address. Apologies that we cannot provide you a direct answer at this point.

Regards,
Arnel C.
n/a Points
2014-12-16 3:45 am

Thanks for help,

i have solved my problem.

the server was locking my file so i deleted it and created it again and it works fine.

n/a Points
2014-12-15 4:49 am

but i am not able to do this .....This is my htaccess data i need to redirect to custom page #DirectorySlash Off

 

#AddHandler application/x-httpd-php54 .php

 

# File modified on Tue Mar 18 10:44:12 2014 by server

# For security reasons, mod_php is not used on this server. Use a php.ini file for php directives

# php_flag magic_quotes_gpc Off

#php_flag register_globals Off

 

# For security reasons, Option followsymlinks cannot be overridden.

#Options -Indexes +FollowSymLinks

# For security reasons, Option followsymlinks cannot be overridden.

#Options -Indexes +FollowSymLinks 

#RewriteCond %{QUERY_STRING} src=/~sbtester/images/uploads/

#RewriteRule ^src=/~sbtester/images/uploads/$ src=http://60.195.124.171/~sbtester/images/uploads/ [R=301]

Options -Indexes +SymLinksIfOwnerMatch

 

<IfModule mod_rewrite.c>

RewriteEngine On

 

RewriteCond %{HTTPS} on

RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

 

RewriteCond %{QUERY_STRING} src=/images/uploads/(.*)

RewriteRule ^phpthumb/phpThumb$ /$0?src=http://www.sbtester.com/images/uploads/%1 [L]

 

RewriteCond %{REQUEST_URI} !^.*/serverReturns/.*\.php$

RewriteCond %{REQUEST_URI} !^.*/cron/.*\.php$

RewriteCond %{REQUEST_URI} !^.*/test\d*\.php$

RewriteCond %{REQUEST_URI} !^.*/uploadify/.*$

RewriteRule !\.(css|jpg|js|gif|png|ico|eot|woff|ttf|svg|swf|pdf)$ dispatch.php

 

</IfModule>

Staff
29,167 Points
2014-12-15 12:16 pm
Hello Krish,

Are you using any sort of content management system such as Joomla, WordPress, etc? If so, it is not likely possible to perform this as it will specifically need index.php.

Kindest Regards,
Scott M
n/a Points
2014-12-17 9:50 am
Ur going well the article with screenshot and written steps helps to understand easily.Thanku..
n/a Points
2015-01-02 12:33 pm

Hello

I am confused with this one. I use two languages in my web. English and Indonesian, but when I turn on the url friends, always appears a message like this This page is not available We're sorry, but the Web address you've entered is no longer available. To find a product, please type its name in the field below. that is confusing is when I type a web url, by default that appears is www.mydomain.com/ID/page-not-found or www.mydomain.com/en/page-not-found. whether this is due to his .htaccess? what should i do? please help thank you

Staff
5,224 Points
2015-01-02 12:57 pm
Hello Ardhi,

What CMS system are you using? Have you tried clearing your browsers cache after making the changes? Can you please provide your domain so we may see if we can troubleshoot further?

Kindest Regards,
TJ Edens
n/a Points
2015-01-02 1:18 pm

hello Mr. TJ

I'm using prestashop. I've cleared the cache, but the result remains the same.

for my .htaccess i set permissions 777, is this wrong? there is also a confusing me, I use two languages, but why when I changed the language, the products I change in Indonesian did not change in English? www.indoislamicpedia.com please help regards, Ardhi

Staff
5,224 Points
2015-01-02 5:00 pm
Hello Ardhi,

The files permissions for the .htaccess file should be 644. Here is a guide on adding other languages to prestashop.

Kindest Regards,
TJ Edens
n/a Points
2015-01-29 10:55 pm
How can a user set the server to automatically open his wordpress home page after immediately installing it?
Staff
26,266 Points
2015-01-30 7:39 am
Hello Pentanol,

We're not sure what you're asking, because once you have WordPress installed, the first thing that appears when you type your website URL, is the home page. Your internet browser goes to the page that you set it to go. If you're trying to make the WordPress site your home page, then you need to set your browser settings to do that. WordPress also has an Administrator login page. That is not the first page of the actual website - just checking to make sure that you are aware of this. If you can please explain exactly what you're trying to do, then we can try to provide further assistance.

If you have any further questions or comments, please let us know.

Regards,
Arnel C.
n/a Points
2015-01-30 6:49 am

Hello

I am not happy with search results for my website's homepage.  My website is built in magento and when i search for "raw audio brand" in Google. My search result for homepage appears as "raw audio raw audio" twice a time. I don't like this. Even my homepage title is different.

Can anyone help me to resolve this issue or any guidance.

 

Thanks

Arun

 

Staff
26,266 Points
2015-01-30 7:35 am
Hello Arun,

Sorry for the problem with the search result. You can (and should) take the issue up directly with Google using Google's WebMaster tools. You should also look at the search terms and any text being used to describe your site. It would also help if you provided information on your website such as the URL and how you built it. Please provide us a little more information and we can look into the issue further.

If you have any further questions or comments, please let us know.

Regards,
Arnel C.
n/a Points
2015-03-10 10:25 pm
Just what i needed where i am working on my site but i want my vistors to see that we are still making it and for the home to be index.html not index.php
n/a Points
2015-03-18 8:17 am

how to do my login page is default index page and after that open home page of my shop

Staff
17,887 Points
2015-03-19 9:54 am
Hello amit,

Thank you for your question. Are you using a CMS such as Joomla, WordPress, etc? If so, it may be easier to set this up in the Admin Dashboard.

Can you provide a link to your site? This will allow us to view your current setup.

Thank you,
John-Paul
n/a Points
2015-03-20 1:30 am

my weblink is ecommerce.capixatech.in

Staff
29,167 Points
2015-03-23 1:24 pm
Hello Amit,

It appears you are using IIS and ASP for your site. This article is for APache web servers. IIS does not have a .htaccess file. It uses a file named web.config. It will have its own format for changing the default index page.

Kindest Regards,
Scott M
n/a Points
2015-03-30 1:00 pm
Thank you for this information.
n/a Points
2015-04-02 8:19 am

I'm doing SEO for a website. I want to redirect all old URLs to new URLs but all old URLs going to the home page. The guy who did the new website added htaccess coding. I can see two htaccess files in the server. One file is htaccess and second file is htaccess- Website is not working if I deleted one of them.

This is the first htaccess file coding

DirectoryIndex index.php
RewriteEngine on

RewriteCond %{QUERY_STRING} ^ln=([a-z]+)$
RewriteRule ^chi/area_sta.php http://example.com/%1/news? [L,R=301]

RewriteCond %{QUERY_STRING} ^ln=([a-z]+)$
RewriteRule ^chi/chi.php http://example.com/%1/contact-us? [L,R=301]

RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ ./index.php/$1 [L,QSA]  

This is the second htaccess- file coding

DirectoryIndex index.php
RewriteEngine on

#RewriteCond %{HTTP_HOST} !^www\.
#RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ ./index.php/$1 [L,QSA]  

I Know 301 permanent URL redirect but when I put them they just go to the home page. Please help me. Tell me should I do. Thank you very much. This website is manual coding cms system. There are another two htacess files in "system" and "application" folder but when I open it says "Deny from all" I'm asking this same question since 2 weeks ago on other forums but no one helps. Please help

Staff
29,167 Points
2015-04-02 1:44 pm
Hello Shane,

You will want to check out our article on 301 redirects for the correct format for your situation.

Kindest Regards,
Scott M
n/a Points
2015-04-02 3:31 pm

I checked the article but my situation is unique I think. It doesn't help. Thanks for your help anyway. I have to submit this in to another website. I hope someone will help :(

Regards

Nimantha

n/a Points
2015-04-14 1:02 am

HI

 

I have just registered my domain, website is under construction. I have tried the above, however seems there is NO .htaccess File.

Any help would be much apprectiated

Staff
26,266 Points
2015-04-14 11:50 am
Hello Alex,

The .htaccess is a hidden file. If you're using the cPanel File Manager and you have not set it to view hidden files, then you will not see the .htaccess file. You can reset the File Manager settings by logging into cPanel and then going to the bottom of the screen and selecting "reset all interface settings". Then when you go into the file manager, make sure to click on "Show Hidden Files". This will let you see the .htaccess file. If you created an .htaccess file previously, remember that case (no capital letters) and the period at the front of the file name are required for this file to operate correctly.

I hope this helps to answer your question, please let us know if you require any further assistance.
Regards,
Arnel C.



n/a Points
2015-05-11 6:59 am

HI. How To set The default URL for same page in my Website..

Like., My website is www.mahindracarspares.com ., and I want to set the default URL is www.mahindracarspare.com in every pages of my websites .. So How can I do  This ??

 

Staff
5,224 Points
2015-05-11 2:47 pm
Hello Abhay,

Your best bet would be to put a 301 redirect in your .htaccess as in the example below:

RewriteCond %{HTTP_HOST} ^DomainA.com
RewriteRule ^(.*) http://DomainB.com/$1 [P]

Best Regards,
TJ Edens
n/a Points
2015-05-29 9:26 am

i receive the error message after i transfered from wamp to online server.i dont know the next file to edit so that it will start displaying.am confused here.can some one help me out

Unable to open WampServer's config file, please change path in index.php file

Staff
5,224 Points
2015-05-29 10:11 am
Hello Chris,

Is the server you are using online a WAMP server as well? This may not work if you try uploading content directly from WAMP to linux or windows servers. Can you provide the error that you are getting so we may try to troubleshoot further.

Best Regards,
TJ Edens
n/a Points
2015-06-01 6:07 am

Thank you so much, this post helped me a lot.

n/a Points
2015-06-03 7:28 pm

Exactly what I was looking for, sweetheart :)

n/a Points
2015-06-17 1:18 am

Thanks for the infor Team.

 

Kind Regards

john

n/a Points
2015-07-16 8:41 am

Thank you so much, this post helped me a lot

n/a Points
2015-07-16 8:42 am

Thank You

Kind Regards Sushant

n/a Points
2015-07-19 3:59 pm

I am hoping to set up a Prestashop site with inmotion but I want visitors directed to a custom "coming soon" teamplate that I purchased separately.  It is NOT a prestashop plugin but a standalone template with separate css, js, etc. files.  My concern is that some of these files and folders may be named the same in Prestashop and I would assume that will create problems.  Is it possible to place all of the coming soon files and folders in a separate folder and use the htaccess file to access the index.html within that folder so visitors will be directed to my coming soon page while I get my Prestashop site completed?  Or...is there some other approach I should take?  I've worked hard to set up the coming soon page just the way I want and I don't want to have to abandon it.  

Staff
29,167 Points
2015-07-20 4:19 pm
Hello Dan,

Yes, just put the folder name in the front of the file name "folder/index.html" for instance.

Kindest Regards,
Scott M
n/a Points
2015-07-25 2:42 pm

I've changed this file to redirect me to the blog, but now I want the default file. where can I get it?

Staff
17,887 Points
2015-07-27 11:16 am
Hello Mo'az,

Thank you for contacting us. By default, there is no .htaccess file in your account. But, you can simply create a new file named .htaccess and use it.

Alternately, if you are using a CMS (such as WordPress, Drupal, Joomla) you can download its default .htaccess file from them. Be sure to download the exact same version you are using for your site.

Thank you ,
John-Paul
n/a Points
2015-08-07 12:54 am

i have built my website in core php but when i make my default page index.php then its title shows untitled document even though i have changed my title part how can i resolve this issue

Staff
17,887 Points
2015-08-07 2:38 pm
Hello konarch,

Thank you for contacting us. When you make a change, you may have to clear your browser cache before testing.

Also, as a test you can try creating an index.htm file, and just putting some text. This should display in your browser. Then remove it, and the index.php file should load.

Thank you,
John-Paul
n/a Points
2015-08-10 7:40 am

Thanks its working

n/a Points
2015-08-14 2:02 pm

thanks you help me alot

n/a Points
2015-08-24 6:55 am

I want an landing page with a big image, after clicking on the image the homepage shoul appear. I am using prestashop. Please anyone help me.

Staff
5,224 Points
2015-08-24 4:12 pm
Hello Riya,

There is no way to do this in PrestaShop natively, however if you have PrestaShop located in a folder called /shop then you could have an index page that when clicked (or what ever the action you want to be) it redirects to mydomain.com/shop.

Best Regards,
TJ Edens
n/a Points
2015-08-25 8:07 am

With all the different types of ideas out there about how to redesign and relaunch an old html or shtml site as a new wordpress site (for example) without having to move files and worry about relative file structure and SEO, changing root folder file priorities seems the simplest. 

Why not just prioritize the old index file (in my case index.shtml for many older sites) and build the WP site in the same root directory. The domain name will call the old index.shtml and no one will see index.php while you are working on the new site unless they type in index.php. Meanwhile both versions of site exists the whole time in root directory. Then when ready to relaunch, do your 301 redirects and then alter htaccess back to default (or just remove) and all pages will still exist but domain URL will now call the new site index.php. No big transfer of files. 

I guess the only question is how to do it best:

This might be one way: https://documentation.cpanel.net/display/ALD/DirectoryIndex+Priority

But your .htaccess mod may be easier, and doesn't require a reboot. Am I missing something here? The other recommendations I've heard and read about with moving files from a local machine to web or from folder to folder seem much more precarious.

THX!

Staff
5,224 Points
2015-08-25 9:19 pm
Hello Wil,

No you seem to have hit all the points as I would suggest the .htaccess method as well. Thank you for your input.

Best Regards,
TJ Edens
n/a Points
2015-08-26 8:24 am

Thanks for the feedback TJ. We're planning to migrate our reseller base to you guys in early 2016. Your responsiveness (here and elsewhere) is a big part of that decision.

n/a Points
2015-08-31 10:00 am

Wow! This was simply amazing

-SAM

Post a Comment

Name:
Email Address:
Phone Number:
Comment:
Submit

Please note: Your name and comment will be displayed, but we will not show your email address.

64 Questions & Comments

Post a comment

Back to first comment | top

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!