Solved

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

Posted on 2010-09-08
7
1,044 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 learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
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

Save the day with this special offer from ATEN!

Save 30% on the CV211 using promo code EXPERTS30 now through April 30th. The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

Question has a verified solution.

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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…
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…

724 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