FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


How to Auto direct traffic to index.php?





Snizneth
I know that this is such a newbie question, but despite my best google attempts, I cannot find an answer that works.

when you go to my root site www.mysite.frih.org it doesn't automatically redirect the browser to www.mysite.frih.org/index.php

how can i get it to automatically direct traffic to index.php?

Thank and sorry in advance.
rvec
delete the index.html file (and put a index.php file in there instead) or rename index.html to index.php
ocalhoun
alternately, you can put a redirect script in whatever file it is going to, which will redirect any browser that hits that file immediately to wherever you want them to go. (I'm currently using one to redirect from onet.frih.net/index.html to equinedream.org/index.php)
Just look it up online, and you'll easily find a ready-made java redirect script.
rvec
ocalhoun wrote:
alternately, you can put a redirect script in whatever file it is going to, which will redirect any browser that hits that file immediately to wherever you want them to go. (I'm currently using one to redirect from onet.frih.net/index.html to equinedream.org/index.php)
Just look it up online, and you'll easily find a ready-made java redirect script.

If you want to do that a .htaccess file (with mod_rewrite) would be easier than javascript.
jmlworld
rvec wrote:
ocalhoun wrote:
alternately, you can put a redirect script in whatever file it is going to, which will redirect any browser that hits that file immediately to wherever you want them to go. (I'm currently using one to redirect from onet.frih.net/index.html to equinedream.org/index.php)
Just look it up online, and you'll easily find a ready-made java redirect script.

If you want to do that a .htaccess file (with mod_rewrite) would be easier than javascript.


Yea! .htaccess redirection is better than JS, because, there may be users who disabled the JS from their browsers and there's still browsers which don't support JS partially.

If I want to redirect from a site 1 to site 2 with out changing the file/path, .htaccess is the best solution, however, if I want to redirect from file1 to file2 in the same website, I'll use <meta> tags to do so, without JS or .htaccess!
Diablosblizz
There shouldn't be a need for a .htaccess file if the host is Frihost. If you delete the index.html it will automatically redirect to index.php.
Snizneth
Thank everyone. Deleting the .html file worked. Thanks again.
kv
rvec wrote:

If you want to do that a .htaccess file (with mod_rewrite) would be easier than javascript.


I know Snizneth found the solution deleting index.html, but here is a pure html way of redirecting - in case someone needs it.


in the head of index.htm/l insert this
Code:

<meta http-equiv="refresh" content="1;url=index.php">


This works on most of the browsers, even with JS disabled (except some old text browsers like lynx), and does not require .htaccess.
Snizneth
[quote="kv"]
rvec wrote:


in the head of index.htm/l insert this
Code:

<meta http-equiv="refresh" content="1;url=index.php">


This works on most of the browsers, even with JS disabled (except some old text browsers like lynx), and does not require .htaccess.


Wonderful, I think you may have answered another question that I have. I also have the .com version of my .org domain. Does that mean that i can have the .com redirected to my .org by entering in the same code with the full URL instead of "url=index.php"?

Thanks again, I love this community.
kv
Snizneth wrote:


Wonderful, I think you may have answered another question that I have. I also have the .com version of my .org domain. Does that mean that i can have the .com redirected to my .org by entering in the same code with the full URL instead of "url=index.php"?

Thanks again, I love this community.


yes, exactly. It is as simple as that.
sonam
It is easy redirect page to page but, how I am read, this is not good for SEO. For search engines are better to remove index.html (first rvec sugestion). Also, I am not sure, but maybe you can in CP or DA to use ad domain to send users from different domains on your current index.php.

Sonam
DoctorBeaver
I set a global variale in index.php then, at the head of each other page, I check to see whether that variable is set. If it isn't, I redirect to index.php in case tries to go directly there bypassing the index page. Simple but effective.
Fire Boar
You could always use a domain pointer to point your .com domain to the .org, then remove the .com from your website directories entirely. Or a .htaccess redirect. Those are the two best solutions, it just depends on whether you want visitors to .com to see ".com" (in which case the former is better) or ".org" (in which case the latter is better) in their address bar.
AOP Web Development
you can used ht access rewrite to make change everything traffic into 1 it also improve your seo
Related topics
http://tuvanonline.com/library/index.php
Script php about gallery
PHP index page not displaying problem
403 Error On My Smf Forums Index.php
i cant load my index.php
forums/index.php to /forums
saving variables
Index.php not found
http://www.funworld.frih.net/index.php
my website won't display... problem with index.php
fatal error in Joomla installation "index.php"
Google Indexing .Com and .Com/index.php --> Redirect
[TuT]JOOMLA Installation Guide(Easiest Way)
Site won't redirect to /index.php
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.