htaccess

Discussion in 'HTML & Website Design' started by Morrile, Nov 22, 2007.

  1. #1
    Hello Folks,

    I am trying to create a .htaccess which will permanently redirect my old site to the new, but I have a small problem. My old site was created with FrontPage so all the pages end with .htm and the new site was created with Dreamweaver CS3 and therefore ends with .html.

    If I use the following code below

    Redirect 301 / http://www.mynewwebsite.com/

    it redirects with index.htm and not index.html. How can I get around this quandary? I have tried to enter index.html at the end of the above code, but that just adds that to the end i.e. index.htm/index.html

    Morrile
     
    Morrile, Nov 22, 2007 IP
  2. mikemdg

    mikemdg Member

    Messages:
    68
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #2
    Try:

    Redirect 301 /index.htm http://www.mynewwebsite.com/
     
    mikemdg, Nov 22, 2007 IP
  3. Morrile

    Morrile Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I will admit I am a little ignorant,being a newbie, but that does that extra code do?
     
    Morrile, Nov 22, 2007 IP
  4. mikemdg

    mikemdg Member

    Messages:
    68
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #4
    ..........
     
    mikemdg, Nov 22, 2007 IP
  5. mikemdg

    mikemdg Member

    Messages:
    68
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #5
    Did it work?
    The code is pretty simple...
    Tells it to redirect permanently to the new location from "/index.htm" or whatever your page is... then a space and the new url to send it to.


    for instance, you could write: Redirect 301 /oldversion.html http://www.mysite.com/newcoolerversion.html
     
    mikemdg, Nov 22, 2007 IP
  6. Simplelance

    Simplelance Peon

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Hi I don't know if this will correct your problem try it and see if it helps:

    Here's the code:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
    <title>Your Page Title</title>
    <meta http-equiv="REFRESH" content="0;url=http://www.the-domain-you-want-to-redirect-to.com"></HEAD>
    <BODY>
    Optional page text here.
    </BODY>
    </HTML>

    Code Description:

    <meta http-equiv="REFRESH" content="0;url=http://www.the-domain-you-want-to-redirect-to.com"> is the part that actually does the redirecting.

    The number preceding the url (in this case zero) tells the browser the number of seconds to wait before redirecting to the new url.

    You could set this to 5 and add some optional text to your page - something like:

    "Please wait while we redirect you to our new site".

    That's it! Just copy the code, save it (i.e. save as index.html) and your html redirect will work perfectly.
     
    Simplelance, Nov 22, 2007 IP
  7. Morrile

    Morrile Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Hello Folks,

    Many thanks Simplelance for your imput. I do have <meta http-equiv="REFRESH" but I have read that search engines don't like that. They prefer a 301 .htaccess file. Mikemdg was helpful, but once it's rediredted is still uses the .htm and not .html and that is what's bugging me
     
    Morrile, Nov 22, 2007 IP
  8. Morrile

    Morrile Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Mea culpa, got me \ and / mixed up
     
    Morrile, Nov 22, 2007 IP
  9. Simplelance

    Simplelance Peon

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Try this page

    //http://www.webconfs.com/how-to-redirect-a-webpage.php
     
    Simplelance, Nov 25, 2007 IP