0

I'm making a website, and my index is a php file, whereas the other 6 pages are html. Whenever I click on the "Home" button, it says that it can't find index.html, but that's obvious because it's called index.php. Any way to fix this? If I'm being too vague, then please let me know what information I can provide you with to help you help me. Thank you!

4
Contributors
7
Replies
9
Views
5 Years
Discussion Span
Last Post by rfrapp
0

Do checked your home menu URL ? What u have provide? index.php (or) index.html ?

The name of the file is: "index.php," and all the links link to "index.php"

1

Hi rfrapp,

I'm guessing your 'home' button doesn't actually link directly to index.php but just to the root directory. When a directory address is requested, the default action is for it to load index.html

You can change this by adding the following line to a .htaccess file DirectoryIndex index.php index.html The default action will now be to try and load index.php and if it can't find that to load index.html

0

Hi rfrapp,

I'm guessing your 'home' button doesn't actually link directly to index.php but just to the root directory. When a directory address is requested, the default action is for it to load index.html

You can change this by adding the following line to a .htaccess file DirectoryIndex index.php index.html The default action will now be to try and load index.php and if it can't find that to load index.html

Thank you very much! So where exactly would that file be located? Sorry, I'm new to PHP.

0

Could you at least print out your links here to stop us guessing? e.g.

<a href="/index.php">home</a>

You've got php installed? Is this local or remote server?

0

Hi again,

If you have a .htaccess file already it should be in the same folder as your index.php page. If you don't already have one you can create your own. Use notepad or another simple text editor, type in the line I gave you in my last post, then save the file as
.htaccess (notice the dot)
NOT
.htaccess.txt
It's a bit of an odd way to name a file but that's the how it is :)

0

Hi again,

If you have a .htaccess file already it should be in the same folder as your index.php page. If you don't already have one you can create your own. Use notepad or another simple text editor, type in the line I gave you in my last post, then save the file as
.htaccess (notice the dot)
NOT
.htaccess.txt
It's a bit of an odd way to name a file but that's the how it is :)

That worked perfectly! Thanks again!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.