ive created an enter page for wordpress and what im wondering is how do i put it as the index page when the index page has the code to load wordpress? how and where do i place the enter page? thanks
There's setting in wordpress admin page which doesn't involve manual setting in .htaccess.
Besides the fact that splash pages are so very wrong... (the only defensible exception I can think of is for an adults only site that asks you if you are 18 or older), you could set it up as index.html and ensure your .htaccess has
DirectoryIndex index.html index.php
Things that you could do ...
Put the splash page on /index.html and put wordpress in /site/ (or something else innocuous); put a redirect on /index.html -> /site/ after the splash is done.
Put the splash page as a page named 'Splash' in Wordpress, with its own template. In the Reading settings page, set the 'Front Page' as 'Splash'. Redirect to the index page after the splash is done.
Put the splash page as a page named 'Splash' in Wordpress, with its own template. Modify index.php in your theme to check for a cookie -- if the cookie isn't present, load the Splash page instead of processing the Wordpress Loop. Once the splash page is done, set the cookie and redirect to the index page.
A route that's worked for me is to bypass the WordPress core files and do everything from your theme folder. So, for example, in your theme folder (WEBROOT/wp-content/themes/YOURTHEMEFOLDER) add a home.php file, and in that file, add whatever code you'd like to use for that first page. By default, WordPress looks for a file named home.php, if it finds it, it will use it first, if it doesn't find it, it will use the index.php next. Since you'd like to use both, it will use home.php for your home page / site default page & then every other page can use the index.php page.
Also, there's other template files that WordPress will look towards before it displays the index.php page - for a detailed list / illustration of this go to http://codex.wordpress.org/Template_Hierarchy & scroll down a little.
Related
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?
I've just installed WordPress and I want to work on the theme. So I need to have an under construction page. I made an under.html file and addressed it in the .htaccess file as a default page.
But when I want to go to mydomain.com/index.php to see the WordPress main page and work on the theme, It redirects to mydomain.com again and shows me that under.html.
Any solution to have both under.html as the default page and the wordpress first page at the same time?
If you want to show an under construction page, you can simply use a plugin.
https://wordpress.org/plugins/wp-maintenance-mode/
Hope this will work for you.
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.
I have to set a temporary html splash page, but ensure all links remain the same.
Hence the root / still launches the Wordpress home page but the fist page shown when users hit the site will be first.html
Can anyone provide ways of doing this via htaccess or any other way?
The site is running in an Apache environment with CPanel.
You can use this in your .htaccess to set the default index page
DirectoryIndex first.html
But then how are you going to get to your wordpress site after that shows? You'd have to use some type of Javascript redirect or meta refresh and modify your .htaccess rules. If I was going to do something like this, I'd use a plugin that is designed to have a splash screen and then show the site. There seems to be several usable ones.
https://wordpress.org/plugins/search.php?q=splash
I finally figured it out, so in case this helps anyone else...
I added this to my .htaccess file:
DirectoryIndex first.html index.html index.php
Then in my functions.php file I added the line:
remove_filter('template_redirect', 'redirect_canonical');
The above line allows the Wordpress front page to run from /index.php
If this line is missing then the index.php page keeps redirecting back to / and displaying first.html
Now the home page and site can stay where it was without modifying any configuration settings and the permalinks can remain unchanged.
When we no longer want the first.html to display, we remove the line in the htaccess and the filter call.
I've got a web site based on wordpress, I need to temporarily hide the web site.
I thought about using a PHP 301 redirect. I tried to put at the begining of index.php and xmlrpc.php without success. How does wordpress file-structure works?
Tnx
Giuseppe
I've used this for redirects in the same purpose:
http://wordpress.org/extend/plugins/redirection/
I put the temporary html-file that I wanted to display in a folder which was placed in the same place as the main index.php file.
If you really need to hide a website under development, block search engines in Dashboard/Settings/Privacy and use something like WordPress › Absolute Privacy « WordPress Plugins to disable RSS feeds and redirect to a static page you choose.