?
Solved

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

Posted on 2010-09-08
7
Medium Priority
?
1,052 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

 
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 1600 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
The purpose of this video is to demonstrate how to prevent comment spam on a WordPress Website. This will be demonstrated using a Windows 8 PC. Plugin Akismet will be used. Go to your WordPress login page. This will look like the following: myw…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
Suggested Courses

752 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