Solved

index.php vs index.html Apache/Wordpress redirect issue

Posted on 2010-09-08
7
1,015 Views
Last Modified: 2012-05-10
I have a Wordpress site running live next to an old site. Wordpress has index.php as home and the old static site index.html. In .htaccess I have
DirectoryIndex index.html index.php

Open in new window

. But somehow Wordpress replaces site/index.php by site and I am redirected to index.html. Does anyone with Wordpress 3.0.1 and or Apache 2 knowledge know how this is caused and how I can remedy this so I can see Wordpress's homepage as well as the old homepage?
0
Comment
Question by:rhandalthor
  • 3
  • 3
7 Comments
 
LVL 14

Expert Comment

by:Dzynit
ID: 33628117
It's because your hosting server chooses the .html first. The simplest solution is to just rename your index.html file so that the wordpress index.php will have precedence. This way you can type in the name you renamed it to and still be able to see it.
0
 

Author Comment

by:rhandalthor
ID: 33628211
Peopl still need to be able to visit and find the old site @ index.html until the WP site is up and running so renaming would not be the right solution unless I could work with some kind of redirect..
0
 
LVL 2

Expert Comment

by:regality
ID: 33628586
You need to change your httpd.conf so that index.php has precedence. If someone navigates to index.html they will still find it, but if they specify a directory such as / they will go to index.php

Find the line in your httpd.conf (usually either in /usr/local/apache2/conf/ or /etc/apache2/ for linux) that looks something like this:

DirectoryIndex index.html index.php

and change it so that index.php comes first:

DirectoryIndex index.php index.html

Restart your web server and the changes will take effect.Then they go to the php version unless they specify index.html.
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 14

Expert Comment

by:Dzynit
ID: 33628621
Which do you actually want the visitors to see when they first get there right now? The .html or the wordpress?

0
 

Author Comment

by:rhandalthor
ID: 33630674
@ Dznynit Visitors should see index.html
@ regality is is a site on a shared host with no httpd.conf access.
0
 

Author Comment

by:rhandalthor
ID: 33645522
Any ideas Dzynit?
0
 
LVL 14

Accepted Solution

by:
Dzynit earned 400 total points
ID: 33648344
I think what I did the last time this came up for me and I couldn't do the development part in a sub-directory then move to root was:

Set the wordpress home page in the settings. Then in the page, I used a javscript redirect to index.html.

From there, I just had to bookmark another wordpress page to go in to see the blog area instead of just the root url.

Let me know if that works.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now