Solved

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

Posted on 2010-09-08
7
1,024 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
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 
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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Envision that you are chipping away at another e-business site with a team of pundit developers and designers. Everything seems, by all accounts, to be going easily.
Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Click on Too…
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…

813 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

18 Experts available now in Live!

Get 1:1 Help Now