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 rename index.php to home.php and put a flash in index.php. In the flash I make an effect and after it played 5 minutes it redirects to home.php.

I put this code:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /home.php [L]
</IfModule>

in my .htaccess file.

I turned on the permalinks to example.com/sample-post and all the posts links are ok. But example.com/home.php is not ok. If I set permalinks to example.com/?p=123 all the links are not ok. The example.com/home.php is ok. The home page content is from themes/mytheme/index.php.

How to correct example.com/home.php?

what i want:

i want to add a flash to my site,namely,when access my site, first shows the flash, after some minutes,then redirect to the home page. on the flash, there is a link "enter to the website".

the way i am able to think is the following, in the flash i add code

stop();getURL('example.com/index.php','_self'). then create a file named index.php. put the invoke flash code in it. then rename the default index.php name to "fhp.php".

but it's not work. how to correct it?

share|improve this question
add comment

1 Answer 1

how to correct example.com/home.php?

First, put things back the way you found them. Both index.php and home.php are reserved file names. And index.php is special not only to WordPress but to the server itself-- look into DirectoryIndex. You should not be manipulating them in this way. Unless you really know what you are doing you will cause trouble for yourself.

If you want to force your user to watch your Flash animation, which I strongly discourage-- I would leave your site and never return, plus iOS does not support Flash and Adobe has stopped making the mobile player for Android-- you probably want something like:

function force_feed_flash() {
    if (is_home() || is_front_page()) {
        wp_safe_redirect(home_url('your_flash_page'));
    }
}
add_action('template_redirect','force_feed_flash');

Your Flash player can redirect back to the proper site when it is done. I am not sure I have the condition for the redirect right, but you should be able to work out when you want the redirect to occur and when you don't.

share|improve this answer
    
when i change home.php to homepg.php. it still not work.why –  linuxlearner Mar 30 '13 at 0:55
    
i put your code in function.php. the home page still not work. –  linuxlearner Mar 30 '13 at 1:21
    
i put a link in the flash. "enter the site" the code is stop();getURL('example.com/index.php','_self'). but it redirect to example.com/home.php –  linuxlearner Mar 30 '13 at 1:27
    
If this post is an indication, what you have done is not what I said to do. –  s_ha_dum Mar 30 '13 at 3:01
    
i tried you have told,it doesn't work. when i access the home page. –  linuxlearner Mar 30 '13 at 4:59
show 3 more comments

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.