hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Programming Discussion : Problem with htaccess
Reply

Forum Jump

Problem with htaccess

Reply Post New Thread In Programming Discussion Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old
Newbie
 
Join Date: Oct 2013
Posts: 27

Problem with htaccess


Hi guys ,
I'm running a wordpress website . I use two index files . one is index.html and the other is index.php . As you know when there are two index files , if you open your site.com , by default index.html loads . I want to redirect index.html to index.php after it loaded . I mean I want index.html to load first and then redirects to index.php . how can I do this ?



Sponsored Links
  #2  
Old
Temporarily Suspended
 
Join Date: Jul 2014
Location: Malaysia
Posts: 62
Quote:
Originally Posted by mastermovie View Post
Hi guys ,
I'm running a wordpress website . I use two index files . one is index.html and the other is index.php . As you know when there are two index files , if you open your site.com , by default index.html loads . I want to redirect index.html to index.php after it loaded . I mean I want index.html to load first and then redirects to index.php . how can I do this ?
Code:
cPanel > Domains > Redirects

  #3  
Old
Newbie
 
Join Date: Oct 2013
Posts: 27
thanks for the answer , but it does not work . It stays on index.html and doesn't redirect to index.php

Sponsored Links
  #4  
Old
Temporarily Suspended
 
Join Date: Jul 2014
Location: Malaysia
Posts: 62
Quote:
Originally Posted by mastermovie View Post
thanks for the answer , but it does not work . It stays on index.html and doesn't redirect to index.php
It isn't possible, exactly how would you expect this to work?
How can a single browser window go to two pages at the same time?

  #5  
Old
Newbie
 
Join Date: Oct 2013
Posts: 27
3.pfilm14.ir open this site . it opens an html page that says loading... and after that it moves to the real wordpress site . I want the same

  #6  
Old
Temporarily Suspended
 
Join Date: Jul 2014
Location: Malaysia
Posts: 62
You can try something like this:
Code:
<head>
...
<script type="text/javascript">
    if (document.documentElement) {
        document.documentElement.className = 'loading';
    }
</script>
...
</head>
Stick that in your <head> tag, then add some CSS to hide everything on the page except for your loading animation. For example:

Code:
.loading > body > * {
    display:none;
}
.loading body {
    background:#fff url(../images/loading.gif) no-repeat 50% 50%;
}
Then add some JavaScript to clear the html tag's class name when the page has finished loading:

Code:
// Using jQuery
$(document).ready(function() {
    ...
    $(document.documentElement).removeClass('loading');
    ...
});
Hope this helps. /Source from oxley.

  #7  
Old
Newbie
 
Join Date: Oct 2013
Posts: 27
Thank you I will try them , let you know if they worked

  #8  
Old
Newbie
 
Join Date: Jul 2014
Posts: 12
Rather than using .htaccess you could use a meta refresh to instantly redirect the browser. This way index.html could be loaded and then redirected immediately to index.php.

Add something like this to the <head> section of index.html:

Code:
<meta http-equiv="refresh" content="0;URL='http://www.example.com/index.php'" />

  #9  
Old
Newbie
 
Join Date: Jul 2014
Location: Cochin
Posts: 28
Use the below code in .htaccess so that index.html loads first
Code:
DirectoryIndex index.html index.php
Once you are in index.html, there are many ways to redirect to index.php. Once method will be using javascipt to redirect. you can use 'window.location' to accomplish this.

Cheers!

  #10  
Old
Junior Guru Wannabe
 
Join Date: Jan 2013
Posts: 67
I'm not really sure why you would want to delay loading your index.php file by going to an index.html splash page with auto redirect to the index.php, but you may have your reason.

You can do the meta redirect in the index.html page and have it show your loading text or icon on a delay, say 5 seconds.

Code:
<META HTTP-EQUIV="refresh" CONTENT="5;URL=the-other-page.html">
Or, if you simply want the index.php to display before the index.html, then set the following code in your .htaccess file:

Code:
DirectoryIndex index.php index.html
This makes the webserver look for the index.php file first, and then index.html if it the php file is not present.

__________________
Scott M
InMotion Hosting Customer Community Team


  #11  
Old
Newbie
 
Join Date: Jul 2009
Location: Los Angeles, California
Posts: 9
use the meta refresh as indicated above, but it would help if you said why you want this to happen?

  #12  
Old
WHT Addict
 
Join Date: Sep 2007
Posts: 114
Why don't you just delete the index.html reference if your ultimate goal is to load the index.php file? From my standpoint, I don't see why you want to load the index.html if it isn't where you want the browser to end up.

__________________
EmailHosting.com
http://www.emailhosting.com

Reply

Similar Threads
Thread Thread Starter Forum Replies Last Post
.htaccess problem juventus Hosting Security and Technology 2 03-20-2012 08:04 AM
.htaccess Problem? jisaiah14 Web Design and Content 2 01-12-2012 12:32 AM
htaccess problem danyboy2010 Programming Discussion 2 02-05-2007 02:31 PM
htaccess problem Sillysoft Hosting Security and Technology 2 03-06-2005 03:55 AM
.htaccess problem croakingtoad Programming Discussion 11 04-05-2003 10:02 PM

Related posts from TheWhir.com
Title Type Date Posted
German Firm Arago Receives $55 Million to Support Global Growth of Automated IT Web Hosting News 2014-10-17 00:04:08
Several Google Cloud Services Experience Wednesday Downtime Web Hosting News 2014-10-09 09:51:02
Microsoft Exchange Online Outage of Over 8 Hours Frustrates Customers Web Hosting News 2014-06-25 11:23:55
Microsoft Azure Swap Deployment Feature Restored After Global Outage Web Hosting News 2013-10-31 11:16:53
Outbound Spam Causing Sleepless Nights? Blog 2013-05-13 09:52:21


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
WHT Host Brief Email:

We respect your privacy. We will never sell, rent, or give away your address to any outside party, ever.

Advertisement:
Web Hosting News:
WHT Membership
WHT Membership



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?