301 redirect from HTML

Discussion in 'Programming' started by Jul, Jun 9, 2009.

  1. #1
    Is it possible to 301 redirect HTML files on III shared hosting?
     
    Jul, Jun 9, 2009 IP
  2. crivion

    crivion Notable Member

    Messages:
    1,669
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    210
    Digital Goods:
    3
    #2
    with html only? almost sure you cannot
    but you can do it if you can embed php code
    or simply with .htaccess
     
    crivion, Jun 9, 2009 IP
  3. Jul

    Jul Peon

    Messages:
    162
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks Crivion.

    My site is hosted on the shared IIS server.
    Does this mean there is no way I can do 301 redirect?
     
    Jul, Jun 9, 2009 IP
  4. vasyl

    vasyl Peon

    Messages:
    138
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Try something like
    < %@ Language=VBScript %>
    < %
    Response.Status="301 Moved Permanently" 
    Response.AddHeader "Location", http://www.example.com
    %>
    Code (markup):
     
    vasyl, Jun 9, 2009 IP
  5. Jul

    Jul Peon

    Messages:
    162
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Should I put it in HTML <head>?
    Are you sure it's going to work with static HTML?

    Thank you Vasyl!
     
    Jul, Jun 9, 2009 IP
  6. optimeramera

    optimeramera Peon

    Messages:
    26
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Google and Yahoo has accepted a meta-refresh with a 0 second-delay to be a 301 redirect.

    Put this within the <head>;
    <meta http-equiv=refresh content="0; url=http://example.com/newurl" />
     
    optimeramera, Jun 9, 2009 IP
  7. Jul

    Jul Peon

    Messages:
    162
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Thanks optimeramera.

    Do you know if other SE's rather than Yahoo and Google accept this meta-refresh? How's about local SE's? I'm going to check this option. Will update you later on my findings.
     
    Jul, Jun 9, 2009 IP
  8. stOK

    stOK Active Member

    Messages:
    114
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #8
    http-equiv=refresh is bad thing. And bannable at almost every SE.
    It's better to form a page with clear link on it.
     
    stOK, Jun 10, 2009 IP
  9. Jul

    Jul Peon

    Messages:
    162
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Thanks stOK.
    I think that I'll move my site from IIS to Linux and then use htaccess for 301 redirect.

    Does anyone know if moving the site from IIS to Linux can hurt it?
     
    Jul, Jun 10, 2009 IP
  10. optimeramera

    optimeramera Peon

    Messages:
    26
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    If you're using plain html pages and keep the same domain name it shouldn't affect your site at all.
     
    optimeramera, Jun 11, 2009 IP
  11. stOK

    stOK Active Member

    Messages:
    114
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #11
    I believe (though not sure) IIS has the mechanics to redirect via 301 response. Linux is not necessary I think.
     
    stOK, Jun 11, 2009 IP
  12. Jul

    Jul Peon

    Messages:
    162
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #12
    If I had dedicated IIS hosting it would be possible to configure server settings. But because it's shared hosting - I have no access to server configurations, and the files are .html, so I can't do 301 redirect via ASP or .NET. I ran out of ideas :( If someone has an idea - he's more than welcome.
     
    Jul, Jun 11, 2009 IP