How to change default index page in php
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 htaccess 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. Changing your Default Index File via htaccess
I have website http://mywebsite.com If I hit this URL it take index.php and index.html as default page. How can I make home.php as default page. I have tried this but not working by placing following code inside .htaccess file of public_html
asked Apr 3, 2013 at 5:00
0 You just need
answered Apr 3, 2013 at 5:04
EliEli 14.7k5 gold badges57 silver badges77 bronze badges 2 You need Barring that, the absolutely easiest way to redirect (without the root access to Apache
config and modules) is putting this as
answered Apr 3, 2013 at 5:05
AmadanAmadan 183k23 gold badges224 silver badges284 bronze badges 2 DirectoryIndex directive applies to all subfolders, if you want set diffrent files for each directories, you can use mod-rewrite. To set /file.html as root directory handler, you can use this at the top of your htaccess :
To set a diffrent file as index for a subfolder, use this :
answered Mar 7, 2017 at 17:14
Amit VermaAmit Verma 39.9k19 gold badges87 silver badges109 bronze badges Just try to rewrite
answered Apr 3, 2013 at 5:17
0 How do I change my default Web page?You can tell Chrome to open to any webpage.. On your computer, open Chrome.. At the top right, click More. Settings.. Under "On startup," select Open a specific page or set of pages. Click Add a new page. Enter the web address and click Add. Click Use current pages.. How do I change the default index page in htaccess?Changing your Default Index File via htaccess. Log into your cPanel.. Find the Files category and click on the File Manager icon.. Click Settings at the top right corner.. Select the document root for the domain you are working with and be sure the checkbox next to Show Hidden Files is checked. ... . Look for the .. How can I change the default start page html?default.. Log in to cPanel.. Navigate to the Files section, then click on the File Manager icon.. Navigate to your public_html and go inside the folder where you find the default. ... . Create a New File. ... . Name the new file index. ... . Whatever you put inside the index.. How do I change the default page in cPanel?How to Use a Custom Default Page. Login to cPanel.. Click the File Manager button under Files.. In the left navigation window, click the cpanel3-skel folder, then click the public_html folder.. Click the Upload button, then click the Browse button and select your custom default page, and click the Open button.. |