1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

HTML or Htaccess redirect

Discussion in 'Off Topic' started by Simon, Oct 27, 2012.

  1. Simon

    Simon Active Member

    Hello all.

    I have my landing page located outside of my domain root (mydomain.com/landingpage)

    When a user visits mydomain.com I would like a redirect to (mydomain.com/landingpage)

    I would like only visitors that go to root to be redirected as I have many other sub folders under root.

    In terms of seo what would be best to use. HTML redirect or .HTACCESS redirect?

    Comments and sample code welcome.

    Thanks in Advance
  2. Chris D

    Chris D XenForo Developer Staff Member

    One benefit of a HTML redirect that, as far as I know, you can't do with a htaccess redirect is that you could have a refresh timer with a HTML redirect. So you could display some other HTML such as a redirect message or ads for X seconds. I don't believe you can do this with htaccess.

    This is the code for that. I've assumed you want the redirect to be instant (therefore 0):
    <META HTTP-EQUIV="refresh" CONTENT="0;URL=http://mydomain.com/landingpage">
    That should be treated by Google as a 301 (permanent) redirect.

    I'm not so hot with rewrite rules, but I'm sure someone will suggest something similar.

    I think the important thing is though that Google treats them the same so unless you want some sort of delay, either solution will work.
    Adam Howard likes this.

Share This Page