Making WordPress Index.php My Home Page?
persently http://www.splashhall.org is an index.’html’ page ..i am thinking of using WP for that page ..but it would be an index.’php’ page correct? Wouldnt that mess up the url as it is listed with Google and other search engines?
that is, say someone clicked on splashhall.org at google would that take them to the html page or the php page?
If a user just clicks a link to “splashhall.org” and not specifically to “splashhall.org/index.html” then your web server will most likely send them to the correct place. Virtually all web servers look for “index.html” first, but if it doesn’t exist, they look for other alternatives such as “index.htm” or “index.php” and display the page to the user accordingly.
Most Apache web servers have set the following pages as the default page with a directory.
default.htm default.html index.htm index.html index.php
However, if the default pages were listed exactly as I had listed it (from left to right), the apache file ‘httpd.conf’ would by default look for the default page in the order as listed (from left to right). Therefore since index.html is listed before index.php and you have both a index.html and a index.php in your directory, Apache would load index.html as the default page since that file was listed first.
I would ask your web server support team two questions:
(1): What are the names of the default pages within your web server space?
(2): Is the web server unix/linux based and running apache as the web server?
If so, you can create a file named “.htaccess” (it has to be named .htaccess) and add these lines between the pound signs:
deny from all
Save the file, upload it to the root web directory, and set permissions to 644 (or -rw-r–r–)
This will force the default page to be index.php and if someone went to splashhall.org (without any file extentions) via a link, this should forward them to the spashhall.org/index.php page.
Also, if you want to keep the index.html page, change the name to something like index2.html and change the code references on other pages to this page to index2.html
OK- I’ve been trying to sort this problem out and I’ve consulted a number of threads on this site looking for answers. I’ve created the .htaccess file (since WP has not created it ‘automatically’) and first I inserted this line:
“DirectoryIndex index.php index.html”
into the file as instructed in several threads.
Then I read this thread and changed the .htaccess file to read thusly:
deny from all
DirectoryIndex index.php index.html”
and so far, when I try to preview my site through the dashboard, the index.php does not automatically load, I have to plug it into the URL for it to work.
(and I consulted an external tutorial to learn how to chmod it to 666)
It seems like this problem has plagued a great number of people and so far people have given instructions like, “put this in your .htaccess file” but the instructions are somewhat vague to those of us who are not already hardcore geeks.
If there is something missing in this file, some other data or header information, could someone point me in the right direction as to what that should be, or a really good tutorial on how to formulate an .htaccess file that actually functions?
Because I have created this file as suggested by many, inserted the reccomended commands to make index.php load as the automatic index and have had no such luck.
The fact that this has to be programmed by me on this end of wordpress seems somewhat ridiculous, frankly. If the 5-minute install were really a 5-minute install, I’d be blogging already instead of fucking around with .htaccess files and whatnot… but oh well. Some help in this would be great so I could get back to blogging and confidently know that my readers to get to my index page instead of a listing of my directories.
Do you have any reason to keep the index.html file? If not, simply deleting it will allow the server to fall through to the index.php file…
TechGnome, I presume you are addressing someone else on this thread other than myself, but your assertion doesn’t hold true in my particular case. I don’t have an index.html file in my directory- regardless, the index.php file does not load automatically.
I’m sure there is a simple solution for this that I haven’t sorted out. If someone knows the answer, please post.
It was for the OP.
In your case, though, it sounds like the ISP hasn’t got index.php set up as a default document on the server.
The .htaccess file goes into the root of your blog, same place where the index.php file is. I’m meerly pointing this out as you indicated that you wanted some help with it.
As for your last para…. sigh…. I’m sorry it’s taken this long and that it isn’t working out, BUT…. it sounds like it’s more of a problem with the host rather than the software. It might be a good idea to contact their support and see what’s up (I’ve also heard of hosts who disable the ability to have .htaccess files.) It might be something that they are willing to change on their end. Let them know that the inability to allow index.php to run as a directory index default hinders the script’s ability to run, and that they may lose business from it (yours and other potential customers).
Ahh.. just as you posted this I was calling my administrator, and it’s true, their server was set to disallow the .htaccess file to make changes to the global settings. Of course as soon as he set it so that my .htaccess file could make changes, we encounted an internal server error.
He offered to just set the index.php as the default on that domain, but I pointed out this nebulous issue of WordPress at some point gnerating info for the .htaccess file (I’ve read of this in different support forums or possibly the codex) and that at some point the .htaccess file would be used by wordpress to manage… things.
So uh yeah… fixed my problem – the solution, for those of you who are having this problem, is to make sure that your sysadmin doesn’t block your .htaccess file from making changes.
Then, uh yeah, upload it with the reccommended syntax such as
DirectoryIndex index.php index.html
and you should be good to go.
- The topic ‘Making WordPress Index.php My Home Page?’ is closed to new replies.