Forum Moderators: phranque

Message Too Old, No Replies

A redirect from mysite index to mysite/other dir/

Redirect from index.html to /dir/index.php

         

henry0

4:15 pm on Apr 3, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I need to redirect from a root index.html to /tpl/index.php
FYI this is a new site to be; therefore never been spidered

For a whole bunch of reasons I do not wish setting the content of the tpl/ dir at root level and simply have its index becoming de facto the default index.

I have a few options:

<META HTTP-EQUIV="Refresh" CONTENT="0;URL=http://www.mysite.com/tpl/index.php">

or using .htaccess
redirect 301 /index.html [domain.com...]
Any other options?
Any concerns?

Thank you

sitz

6:28 pm on Apr 3, 2005 (gmt 0)

10+ Year Member



I generally recommend against .htaccess files unless the site maintainer doesn't have write access to httpd.conf, for two reasons:

1) Performance: There is overhead associated with searching for (and parsing) .htaccess files which can be eliminated by having the configuration in httpd.conf

2) Self-documentation: if all the configuration for a site is in httpd.conf, all your configs are in a central place, rather than scattered all over the filesystem. This also applies to the <META> version; if one keeps behavior like isolated to as few places as possible, things are generally easier. As always, of course, there are exceptions to this; for instance, it may be easier for the folks developing the site's content for them to use META tags so that they don't need to engage you every time they want to add a new one. Obviously, this doesn't really apply if *you're* the one developing the site. =)

henry0

6:51 pm on Apr 3, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thank you
I am the sites dev and each user will deal with their own content via admin/edit.
Plus the server load will be minimal so htaccess or meta tags will not create overload or messy structure.

How does Google look at Redirect or Meta tag generated

Knowing that the real content will indeed come out of the root/dir/index.php
and also that I am not redirecting from DN A to DN B

sitz

9:12 pm on Apr 3, 2005 (gmt 0)

10+ Year Member



Based on 15 seconds of unconfirmed research (*grin*), I'd suggest using the .htaccess method over the <meta> method. You *could* also use the mod_rewrite method:

RewriteEngine on
RewriteRule ^/($¦index.html$) /tpl/index.php [L]

This results in a *transparent* redirect; the user will still see 'http://www.example.com/index.html' in their browser. This doesn't appear to be what you want in this case, but I toss it out there as an FYI. =)

henry0

11:01 pm on Apr 3, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks again for answering on an ending weekend

I mostly was seeking advise due to the heavy discussions surrounding 301 and 302

Mostly 302

I will run a test on a "demo" site and check if I am not sent in oblivion!
Cheers