1 (edited by MKG 2006-06-06 04:40)

Topic: Redirect main site index to forum without META refresh tag

Hello,

How can I redirect my main site index to the forum without using a META refresh tag?

In other words:

When someone hits http://www.mydomain.com, I'd like them to be immediately routed to http://www.mydomain.com/forums/

The META refresh tag always takes a fraction of a second, even set to "0", before it forwards to the target URL. A long time ago I remember you could do this with a .htdocs file, but I can't find any help out there. My Google-fu is not as sharp as other people's.

Thanks
MKG

2 (edited by trongha 2006-06-06 04:58)

Re: Redirect main site index to forum without META refresh tag

edit index in http://mydomain.com

Add code in tab <head></head>

<meta http-equiv="refresh" content="2; url=http://mydomain.com/forum/index.php?" />
I'm from Viet Nam. i speak english vey bad! Sorry.

3 (edited by hcgtv 2006-06-06 04:58)

Re: Redirect main site index to forum without META refresh tag

Make an index.php in your web root, with these lines:

<?php header("Location: /forums/") ?>

Oh, rename index.html to index-off.html or else it will serve it first if the Apache server is configured to server html before php.

Re: Redirect main site index to forum without META refresh tag

hcgtv wrote:

Make an index.php in your web root, with these lines:

<?php header("Location: /forums/") ?>

very good in a Host.

I'm from Viet Nam. i speak english vey bad! Sorry.

Re: Redirect main site index to forum without META refresh tag

.htaccess can redirect too, I believe.

Re: Redirect main site index to forum without META refresh tag

many host dont file .htaccess. ex free host.

I'm from Viet Nam. i speak english vey bad! Sorry.

Re: Redirect main site index to forum without META refresh tag

trongha wrote:

many host dont file .htaccess. ex free host.

Doesn't make what I said any less true. smile

8

Re: Redirect main site index to forum without META refresh tag

You can do it with .htaccess but it plays head games with the search engines:

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^mydomain.com [NC]
RewriteRule ^(.*)$ http://mydomain.com/forum/$1 [L,R=302]

A 302 is temporary, a 301 is permanent.

Re: Redirect main site index to forum without META refresh tag

ok!

I'm from Viet Nam. i speak english vey bad! Sorry.

10

Re: Redirect main site index to forum without META refresh tag

hcgtv wrote:

Make an index.php in your web root, with these lines:

<?php header("Location: /forums/") ?>

Oh, rename index.html to index-off.html or else it will serve it first if the Apache server is configured to server html before php.

Worked like a charm! Thank you!

http://www.macinchat.com

As a side note, the more I work with PHP the more I like it!

Re: Redirect main site index to forum without META refresh tag

Spam!

I'm from Viet Nam. i speak english vey bad! Sorry.

12

Re: Redirect main site index to forum without META refresh tag

trongha wrote:

Spam!

What?

Re: Redirect main site index to forum without META refresh tag

Paul wrote:
trongha wrote:

Spam!

What?

I think he deemed MKG's mention of macinchat.com to be spam.

Looking for a certain modification for your forum? Please take a look here before posting.

14

Re: Redirect main site index to forum without META refresh tag

lol..
how about a redirect script with drop down menu's?


put this in a index.php
<form action="/redirect.php">
<select id="goto" name="goto">
<option value="" selected="selected">Jump To Day</option>
<option value="/opera/lover/day01-why/">Day 1: Why</option>
<option value="/opera/lover/day02-install/">Day 2: Install</option>
<option value="/opera/lover/day03-interface/">Day 3: Interface</option>
<input type="submit" value="go" />
</form>


and here is the 'redirect.php'
save below as redirect.php
<?php
    $TARGET = $_SERVER["QUERY_STRING"];

    header("Location: $TARGET");

    exit();
?>

My stuff or my style might sux, but atleast I'm willing to help when I can.
Don't be stupid and help ! We are the stupid one's !!!

15

Re: Redirect main site index to forum without META refresh tag

pogenwurst wrote:
Paul wrote:
trongha wrote:

Spam!

What?

I think he deemed MKG's mention of macinchat.com to be spam.

I hope not, because that's terribly uncool.

Re: Redirect main site index to forum without META refresh tag

sory! :d

I'm from Viet Nam. i speak english vey bad! Sorry.