Can my index file be .php |
Can my index file be .php |
oddcarout |
Feb 26 2012, 11:50 PM
Post
#1
|
Member Group: Members Posts: 62 Joined: 21-November 06 Member No.: 1,017 |
I used PHP to build my site.
I originally used home.php. Can I have my home or index file by .php? right now I have an home.html that points to my home.php. What is the correct way to do this? Please help. Thanks. |
pandy |
Feb 27 2012, 12:39 AM
Post
#2
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
You mean index file as in the file that will be served up if you go with a browser to a directory? It can be anything you like but you must have a way to configure the server. On Apache this is done with a .htaccess file, a configuration file that works on per directory basis and can be used on a shared server.
It's likely the server is already configured to use index.php though. Have you tried? There actually is a list of files. As an example that could be "index.php,index.shtml,index.html". The first file on the list is the server's first choice. If it doesn't exist it looks for the second file on the list and so on. home.php would work as well provided the server is configured to use it. But if it uses home.html, maybe it uses home.php too. If not, you can use the .htaccess file if you are on Apache. Don't know about other servers. |
oddcarout |
Feb 27 2012, 04:51 PM
Post
#3
|
Member Group: Members Posts: 62 Joined: 21-November 06 Member No.: 1,017 |
I have exactly one line in my htaccess file and it is for a script that I have.
can't find it on my hosting server options. How can i do it in the htaccess file? Thanks, |
oddcarout |
Feb 27 2012, 05:07 PM
Post
#4
|
Member Group: Members Posts: 62 Joined: 21-November 06 Member No.: 1,017 |
would I add:
DirectoryIndex home.php index.php home.html index.html Thanks |
pandy |
Feb 27 2012, 05:25 PM
Post
#5
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
Yes. But check if it already works first. Something made home.html work, right?
|
Lo-Fi Version | Time is now: 23rd April 2024 - 01:33 AM |