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.
delete the index.html file (and put a index.php file in there instead) or rename index.html to index.php
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.
| 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.
| 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!
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.
Thank everyone. Deleting the .html file worked. Thanks again.
| 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.
[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.
| 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.
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
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.
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.
you can used ht access rewrite to make change everything traffic into 1 it also improve your seo