Newbie questions about 301 redirects...

Discussion in 'Apache' started by bad_bob00, Jun 27, 2007.

  1. #1
    Hi there,

    I've located the .htaccess file in the logs folder of my website. There is one other main folder (which contains all the files of my website). I'm trying to redirect 4 pages of my website, as I have renamed the 4 pages.
    My .htaccess file has some text already in it, do I just go down to the next available line when adding my text? This is the file so far:

    I'm not sure if I need the /directory/ part because the files are all in the same, parent folder? :confused:

    Thanks for any help offered, will give out reps too ;)
    Matt
     
    bad_bob00, Jun 27, 2007 IP
  2. VimF

    VimF Well-Known Member

    Messages:
    307
    Likes Received:
    27
    Best Answers:
    0
    Trophy Points:
    118
    #2
    I'm not sure I understand what you mean. But I think you might want to put the .htaccess in the main folder.
    They are redirects so generally you can put them anywhere in the htaccess file.
    You won't need the /directory part if the htaccess file is in the same folder with the html files.
     
    VimF, Jun 27, 2007 IP
    bad_bob00 likes this.
  3. bad_bob00

    bad_bob00 Active Member

    Messages:
    3,472
    Likes Received:
    56
    Best Answers:
    0
    Trophy Points:
    90
    #3
    Thanks VimF, reps given. There was already a .htaccess file in the logs folder on my website for some reason, would I be best to move the file or create a new .htaccess file?

    Would this text be okay (as long as I move the .htacess file to the same folder with the html files):
    Thanks again.
    Matt
     
    bad_bob00, Jun 27, 2007 IP
  4. VimF

    VimF Well-Known Member

    Messages:
    307
    Likes Received:
    27
    Best Answers:
    0
    Trophy Points:
    118
    #4
    Maybe create a new one just for the redirection.
    My mistake, actually the full paths to the files are needed. :eek:
     
    VimF, Jun 27, 2007 IP
  5. bad_bob00

    bad_bob00 Active Member

    Messages:
    3,472
    Likes Received:
    56
    Best Answers:
    0
    Trophy Points:
    90
    #5
    Thanks again for the help VimF, more reps on the way.

    I've uploaded the .htaccess file, whats the best way of testing the redirect? By typing in one of the old URL's to check that it takes me to the correct page? I did this and it seemed to work, though the pagerank bar is greyed out on the new page...

    Thanks for any more help.
    Matt
     
    bad_bob00, Jun 27, 2007 IP
  6. VimF

    VimF Well-Known Member

    Messages:
    307
    Likes Received:
    27
    Best Answers:
    0
    Trophy Points:
    118
    #6
    Yup.
    Well, wait untill google crawl the old url again. It's a 301 redirect so no google juice is lost.
     
    VimF, Jun 27, 2007 IP
  7. bad_bob00

    bad_bob00 Active Member

    Messages:
    3,472
    Likes Received:
    56
    Best Answers:
    0
    Trophy Points:
    90
    #7
    Thanks VimF again for the help. I've got one more question - should I update all the links on my website, so that they link to the new file names?

    Thanks again.
    Matt
     
    bad_bob00, Jun 28, 2007 IP
  8. VimF

    VimF Well-Known Member

    Messages:
    307
    Likes Received:
    27
    Best Answers:
    0
    Trophy Points:
    118
    #8
    It isn't necessary. And if there are too many files and links, you might not want to edit them just so it looks good.
     
    VimF, Jun 28, 2007 IP
  9. bad_bob00

    bad_bob00 Active Member

    Messages:
    3,472
    Likes Received:
    56
    Best Answers:
    0
    Trophy Points:
    90
    #9
    Oh right okay, I've edited most of them. I doubt it makes any difference though to SEO etc?

    Thanks VimF
     
    bad_bob00, Jun 28, 2007 IP