Why is a static html page loading instead of Wordpress? - wordpress

I have WordPress installed in my main directory for my website and not in /wordpress. Currently my htaccess file has in it DirectoryIndex index2.html. This points to a static html page that was my landing page before installing wordpress. Now, when I visit my site after having installed WordPress I am still presented with the same landing page as before. What do I need to change to make sure that going to my domain will now point to the PHP pages of WordPress instead of my old html content? The site is on a shared Window hosting plan if that makes any difference

Make sure that you do not have an index.html file in your root WP directory. index.html files have precedence over the index.php files. That explains why the landing page is loading even when you navigate to a subpage of the site.

Just comment this line or change it to
DirectoryIndex index.php

Related

Redirecting website to subdirectory, while retaining index.php file in parent directory to allow access to site archive

I have two versions of a website: the old version uses wordpress for the front end, pages, display etc, whereas the new version does not.
The old site is in the public_html/ folder and is launched from the index.php wordpress file
The new site is in a subdirectory (let's call it public_html/newsite/) and it has its own index.php file.
I'd like the new site to display by default, but have the option of linking back to the old site as an archive.
I have tried editing the .htaccess directory index to prioritize index.html over index.php, and created a new index.html file in the main public_html/ folder which redirects to the new site subdirectory using a simple meta refresh tag.
This works to redirect the site, but even if I explicitly link back to the index.php file in old site parent directory, it loads the index.html file instead
I cannot change the name of the parent directory (old site) index.php because it messes up the wordpress architecture.
Suggestions would be much appreciated.

htaccess, rewriteurl to page of WordPress site in sub-folder

Here's the scenario, I have a single server and two WordPress sites living in their respective sub-folders:
public_html/site_one/
public_html/site_two/
These sites display as follows:
www.site.com/site_one/
www.site.com/site_two/
The second of those sites has a splash page / landing page:
www.site.com/site_two/landing-page/
...that needs to display in the root of the site:
www.site.com/
I'm aware that there are better ways of achieving this, but I'm restricted to working with how it's currently set up.
Initially I thought I would be able to set up a .htaccess file in the root that rewrites access to the root of the site to display the landing page from site_two, but this isn't working as expected. This is the .htaccess file from the root of the server:
RewriteRule ^$ subfolder/page-slug [L]
This redirects to the site's front page. If I replace page-slug with ?p=1234 then it displays as the correct page but also seems to redirect to the landing page's full URL.
Is there any means of achieving what I'm after?
To clarify:
User visits site.com
URL displays as site.com
Page displayed is site.com/site_two/landing-page/
I've managed to have this behaviour working when not linking to a WordPress page (using a test index.php in 'test-subfolder') but WordPress and its own .htaccess file seems to be confusing matters.
Any help would be appreciated. Is there a way of excluding the landing page from the WP .htaccess file and what is it about the WP .htaccess file that's stopping the page being displayed at the root of the site?

Wordpress posts & pages using the wrong index.php

I've updated the main page for my site (http://www.goldfinchnj.com) to show the most recent posts from a wordpress site (http://www.goldfinchnj.com/news) The main page is mostly HTML, but I had to make it a .php file so it would pull in the 3 most recent posts.
The problem is all the pages & posts on the wordpress site seem to be using the index.php file from the root directory (the index for the main page).
Before this issue started, I changed the directory of the wordpress install. It was news.goldfinchnj.com, but I wanted it to be goldfinch.com/news.
Any ideas how to fix this?
How have you changed the directory? Have you updated all links in the database? Manually or you used search and replace plugin? Do you host wp on apache server? Do you have correct index.php in news subfolder and correct .htaccess?
Fixed it. Took another look at the .htaccess and had to update the path for the IfModule mod_rewrite.c

How to locate index.html / index.php in cPanel

I am editing a wordpress website. My client had a team working on editing it and they simply used the Wordpress editor to make changes. When I log in to cPanel, I see a 'coming soon' page in the index.html file. But the changes that the design team made cannot be located in any file. Also, when I access the website with a http, it shows the website (even when it's not supposed to be launched) and when I access the website with a https, it shows the welcome page. I don't know how two different pages are displayed by just changing the transfer protocol. How do I edit the theme?
If it is a WordPress website, the index file should be under this directory:
/website-root/wp-content/themes/ <- then the theme folder.
The theme, that's active on your website should be mentioned under Appearance > Themes. If you're not sure which one it is in /themes directory, look for the title here.
As you have cPanel, you should have an access to .HTACCESS file for your account. You can set index/default page for your website from .HTACCESS file. Please add the following code:
DirectoryIndex MyFileName.html // Replace MyFileName.html with your actual index file name.
HTTP and HTTPS should show the same contents. Please clear browser cache or verify your website from any alternate system or server.

Wordpress point to static html page

I have a static html coming soon page inside a folder.
How to temporary set the wordpress homepage point to this html template folder?
How to temporary set all of the wordpress page point to this html template folder?
The easiers way is to use a wordpress plugin for a coming soon page that support html code and post your code there, why to make a hack to display everywhere an html page in a wordpress site when you can do it with a simple plugin?
If you put this line at the top of the .htaccess file:
DirectoryIndex index.html index.php
It will swap the order in which Apache prioritises the files.

Resources