Solved

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

Posted on 2010-09-08
7
1,040 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
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

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. …
Because your company can’t afford for you to make SEO mistakes, you’ll want to ensure you’re taking the right steps each and every time you post a new piece of content. This list of optimization do’s and don’ts can help you become an SEO wizard.
The purpose of this video is to demonstrate how to Test the speed of a WordPress Website. Site Speed is an important metric of a site’s health. Slow site speed can result in viewers leaving your site quickly and not seeing your content. This…
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…

734 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