Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I want to power my website from http://www.example.com and not from http://www.example.com/foldername

I've completed this task and this is working but before people actually get to the WordPress website they must pass another website-page. See the scheme below.

www.example.com: shows a page with some information and a link to navigate to the wp site.

My problem now is that when I follow the steps on http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory, my index file is fighting with the one from WordPress. I hope people understand the problem.

EDIT

Changing .htaccess to:

DirectoryIndex home.htm index3.php index.htm index.html default.htm

This is working to change the homepage, but as soon you are on the WordPress website and you click on home in the menu, you get back to the homepage set in the .htaccess file.

share|improve this question
    
Why don't you change the menu to point to index.php? –  Stephen Feb 3 '13 at 23:38

2 Answers 2

Here is the code to put in your functions.php file, it will show the splash-page.php only to outside visitors (by checking the referer). Make a splash-page.php in your current theme directory and edit the domain (example.com) in the code:

add_action('template_redirect','my_splash_page');      
function my_splash_page(){ 
    $referer = $_SERVER['HTTP_REFERER'];
    $referer_parse = parse_url($referer);
    if(is_front_page()){
        // let visitors see the normal wordpress homepage if they are browsing your web
        if($referer_parse['host'] == "example.com" || $referer_parse['host'] == "www.example.com") {

        // let visitors see the splash page if they are visiting directly or from another pages
        } else {
            include(TEMPLATEPATH.'/splash-page.php');
            exit();
        }
    }
}
share|improve this answer
    
Birgire what is the difference between example.com and www.example.com in your example. –  Niels Jansen Feb 4 '13 at 10:56
    
it's just to cover both cases ;-) It's different between sites if they use www or not. –  birgire Feb 4 '13 at 11:02
    
Can we continue in chat? –  Niels Jansen Feb 4 '13 at 11:05
    
ps: please remember to vote on the answer, since we managed to solve it with this method, thanks ;-) –  birgire Feb 5 '13 at 11:08

Have you considered using a "splash page" instead?

See for example this tutorial:

http://wp.tutsplus.com/tutorials/how-to-make-a-splash-page-with-wordpress/

where you could use the html code from index.html in the splash screen template.

There are also plugins available to do this.

You can also check out:

http://codex.wordpress.org/Creating_a_Static_Front_Page

That way you don't have to "fight" against the wordpress setup ;-)

share|improve this answer
    
Thanks for you answer, I'm considering the use of the tutorial to create a slash page. What I don't understand there is the last part. How can you change the wordpress homepage (not static vs post page) but when you set a static page as homepage, every time the user clics on the home label or logo, he returns to the splash page –  Niels Jansen Feb 4 '13 at 9:04
    
You can also checkout this plugin: wordpress.org/extend/plugins/wsi it supports image/video/html for the splash page. It will only show the splash page once for each user. –  birgire Feb 4 '13 at 9:12
    
I not want to use any plugings for this. I need to change the links like a told you before. Users must see this page everytime they visit the website –  Niels Jansen Feb 4 '13 at 9:14
    
I would make a new page, fx example.com/articles, and then change the "Home" link in the menu and the logo link to that page. So example.com would be your splash page. –  birgire Feb 4 '13 at 9:34
    
Yes but how do you change them? –  Niels Jansen Feb 4 '13 at 9:35

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.