Announcement

Collapse
No announcement yet.

.htaccess changes - correct method?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    .htaccess changes - correct method?

    Can someone please confirm if what I intend doing in my .htaccess file is correct (always a biy scared when I make changes of this nature). Other posts don't quite give me the confidence factor I need. Also searching on the internet has confused rather than clarified.

    Resulting from Bills comments yesterday (and my tests confirming this) about _ and - in page names I want a plan forward to change my page names. (http://community.actinic.com/showthread.php?t=20688)

    In particular I would like to confirm the changes required to redirect in my .htaccess file.

    Currently the file contains Error Document redirects only. Below is what I believe is correct but can someone confirm this please. Particular questions are:
    1. Do I need the full URLs of the old changed pages and new replacement pages in the rediect statement or is this just required for the replacement page? Just the new page - but the full path from the root should be defined for the old page
    2. Am I correct in thinking that the page name redirects will need to go above the Error Document redirects? - in other words I am assuming they are actioned on a first true first actioned type of basis? Not sure about this?? Confirmed that this is important - the first matching statement will be actioned
    3. Does it matter how many redirects I have in the .htaccess file? Presumably not
    4. Can/Should I just leave the redirects in the file for ever on? Perhaps 1 month or so until the SEs show the new pages
    5. Because they will be permant redirects I assume there will be no issue with SEs? This seems to be the consensus

    This is the typical content I'm proposing to implement:
    Code:
    Redirect permanent Fancylines_News.html http://www.fancylines.co.uk/acatalog/Fancylines-News.html
    Redirect permanent Mens_Guide.html http://www.fancylines.co.uk/acatalog/Mens-Guide.html
    Redirect permanent Sizing_Chart.html http://www.fancylines.co.uk/acatalog/Sizing-Chart.html
    ErrorDocument 400 /index.html
    ErrorDocument 401 /index.html
    ErrorDocument 403 /index.html
    ErrorDocument 404 /index.html
    ErrorDocument 500 /index.html
    This is a very grey area for me and any comment on this would be greatly appreciated.

    EDIT: Bill's link answered some of my questions

    Duncan

    #2
    Good advice here http://www.tamingthebeast.net/articl...1-redirect.htm

    On timing - I tend to leave 301s in place for about a month to let all the spiders and returning visitors see the change, then I remove them. Nothing to support that timing - if you find anything conclusive, I'd be interested in a pointer.
    Bill
    www.egyptianwonders.co.uk
    Text directoryWorldwide Actinic(TM) shops
    BC Ness Solutions Support services, custom software
    Registered Microsoft™ Partner (ISV)
    VoIP UK: 0131 208 0605
    Located: Alexandria, EGYPT

    Comment


      #3
      Thanks Bill - your link helped answer some of my questions. I've updated my post above with the answers in red. There is still one I'm still not sure about - marked in blue in my original post above.

      Comment


        #4
        Duncan - I can't prove it, but I am pretty sure the whole htaccess is read and if a pagename is found, the rule associated with that page name would be followed.

        What this would mean is, if you have a redirect for a page - and later you add a second redirect for the same page, the last one would win, and the first would be discarded - I'll try a test on a non-commercial site and confirm this.
        Bill
        www.egyptianwonders.co.uk
        Text directoryWorldwide Actinic(TM) shops
        BC Ness Solutions Support services, custom software
        Registered Microsoft™ Partner (ISV)
        VoIP UK: 0131 208 0605
        Located: Alexandria, EGYPT

        Comment


          #5
          don't know if you guys have seen this concurrent thread

          http://community.actinic.com/showthread.php?t=20692

          Comment


            #6
            Originally posted by wjcampbe
            Duncan - I can't prove it, but I am pretty sure the whole htaccess is read and if a pagename is found, the rule associated with that page name would be followed.

            What this would mean is, if you have a redirect for a page - and later you add a second redirect for the same page, the last one would win, and the first would be discarded - I'll try a test on a non-commercial site and confirm this.
            What I am trying to determine is if the Error Document redirect would override the pagename redirect if the order of the two statements was wrong, which would obviously defeat the object.

            Comment


              #7
              Hmm - surprise - the first match is followed - the file is not read any further.

              So two redirects on the same page - only the first will have any effect.
              Bill
              www.egyptianwonders.co.uk
              Text directoryWorldwide Actinic(TM) shops
              BC Ness Solutions Support services, custom software
              Registered Microsoft™ Partner (ISV)
              VoIP UK: 0131 208 0605
              Located: Alexandria, EGYPT

              Comment


                #8
                Thanks for that Bill - I guess it confirms my original thoughts that the specific page redirects should preceed the Error Document redirects. And also perhaps for speed to keep the most common redirects at the top of the file.

                Comment

                Working...
                X