Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Help with a 301 Permanent Redirect using .htaccess

Options
  • 12-07-2019 10:21am
    #1
    Registered Users Posts: 3,056 ✭✭✭


    Hi,

    I have a new website ready for launch, but old website files are named different.

    I want to set up a 301 Permanent Redirect using .htaccess so any of the olf html files will redirect to the homepage of the new website.

    I dont see an option in Notepad++ to save a file as htacess.

    Is this the correct code to input?

    ht.png

    Any other quicker or safer ways to do this or is this the best option?

    Thanks!


Comments

  • Registered Users Posts: 396 ✭✭M.T.D


    re notepad++ save as .htaccess and all file types
    if you can't get that to work, then save as text file and edit file name after - htaccess.txt and change to .htaccess
    also it is possible the file will become "hidden" once you change file type

    Redirect 301 /old-file.html http://www.domain.com/new-file.html

    if redirecting to domain name
    Redirect 301 /old-file.html http://www.domain.com/

    You should have ssl cert and use https


  • Registered Users Posts: 3,056 ✭✭✭sticker


    M.T.D wrote: »
    re notepad++ save as .htaccess and all file types
    if you can't get that to work, then save as text file and edit file name after - htaccess.txt and change to .htaccess
    also it is possible the file will become "hidden" once you change file type

    Redirect 301 /old-file.html http://www.domain.com/new-file.html

    if redirecting to domain name
    Redirect 301 /old-file.html http://www.domain.com/

    You should have ssl cert and use https

    Many Thanks!


  • Registered Users Posts: 3,056 ✭✭✭sticker


    Sorry - so this would be correct?

    Old html files redirecting to new domain homepage...

    hta.png


  • Registered Users Posts: 396 ✭✭M.T.D


    That should work
    But for SEO be consistent with your url. In general link is to the domain name
    www.website.ie or website.ie not to website.ie/index.html

    If you want to use index.html make sure that if someone types website.ie. www.website.ie, http://website.ie etc. that they all go to the same place. So no matter what the visitor typed in the browser or link they clicked the url displayed in the browser is consistent.
    Usually the home page displays as the domain name only, with or without the www depending on your preference


Advertisement