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
DirectoryIndex home.php index.html index.php
As a rule the file called index is the default start page. This means that this page will be shown first when you access your domain, directly (www.example.com). Furthermore, index. php will always be shown before index.
You just need home.php
in your DirectoryIndex
to make it works. Remember that this is using in .htaccess file of your root project:
DirectoryIndex home.php
You need AllowOverride +Indexes
in your httpd.conf
to be able to use DirectoryIndex
in .htaccess
.
Barring that, the absolutely easiest way to redirect (without the root access to Apache config and modules) is putting this as index.html
:
<!doctype html>
<html>
<head>
<meta http-equiv="Refresh" content="0; url=home.php">
</head>
<body>
</body>
</html>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With