How to 301 Redirect a HTML page?!

Discussion in 'HTML & Website Design' started by jpf566, Aug 16, 2011.

  1. #1
    Ok I’ve been doing web design for quite some time but haven’t ever needed to do 301 redirect a site before…I have someone who took over a company and also changed the company name so the entire website and domain name has changed. I need to 301 redirect the old site to the new. I know I could just throw an ASP or PHP 301 redirect BUT the problem is that the files are HTML. Wouldn’t that defeat the purpose if I changed all the file names to .ASPX and then redirected them to the new site? All the new .ASPX pages would be seen as new (or worse duplicate) content form google! How in the world am I supposed to 301 redirect html pages? Thanks for any help guys Seriously.
     
    jpf566, Aug 16, 2011 IP
  2. webbocat

    webbocat Greenhorn

    Messages:
    50
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #2
    I think it is very difficult to do a 301 redirect in aspx try canonical tag instead.
     
    webbocat, Aug 16, 2011 IP
  3. Toycel

    Toycel Peon

    Messages:
    243
    Likes Received:
    11
    Best Answers:
    4
    Trophy Points:
    0
    #3
    It is quite simple. In the old domain name web file (the www one where the index and pages are) place a .htaccess file with a redirect in it to the new domain.

    Step by step (it's a piece of piss):

    • Open Notepad
    • type "RedirectMatch 301 (.*) http://newdomain.com/"
    • Save as
    • Select all file types and name the file .htaccess
    • Then upload this file to the old domain name
    • DONE

    The (.*) picks up any page from the old domain and redirects it to a new page you can also edit the code for individual pages although it may just be best to get the redirect to the homepage.
     
    Toycel, Aug 17, 2011 IP
  4. deltagci

    deltagci Peon

    Messages:
    636
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Toylec, you are right.. I had also same issue, now got solved. Thanks for sharing

    Thank you so much
     
    deltagci, Aug 17, 2011 IP
  5. petervanlier

    petervanlier Peon

    Messages:
    260
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    If 301 Redirect code which is placed in the .htaccess file doesn't seem to work, You may just include a canonical relation tag & place it in the source code of the website so that your website url's are not treated unique & not duplicate.
     
    petervanlier, Aug 17, 2011 IP
  6. jpf566

    jpf566 Member

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #6
    My host told me that there is no way I can do anything on there end other than changing the files to .asp and adding a .asp redirect (which defeats the purpose of a 301 since the search engines will see the .asp file extension as different content) My domain is hosted with a different company (godaddy) and they said i should just do a permanent redirect through Godaddy but I've heard that isnt an actually way to do a 301. Im so confused. Maybe I'll just do rel=canonical
     
    jpf566, Aug 20, 2011 IP
  7. krishindia

    krishindia Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Yes, We also had couple of similar instances, but couldn't able to redirect the .asp extension pages. For me it was not domain redirection only a few pages I want to redirect.
     
    krishindia, Aug 22, 2011 IP
  8. unknownpray

    unknownpray Active Member

    Messages:
    3,831
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    70
    #8
    Normally the 301 redirection works in the htaccess file that you would have placed at the root directory of your website. If it doesn't work check with your hosting if they provide the redirection.
     
    unknownpray, Aug 27, 2011 IP