Announcement

Collapse
No announcement yet.

htaccess - 301 redirection problem

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

    htaccess - 301 redirection problem

    I know this has been covered a 1000 times before but I can't seem to get this htaccess file to work properly. What should be a simple task is giving me grey hairs (well more anyway).

    I have just created a new information site in Actinic to replace an old one created in DW. The pages have changed and I want to implement permanent redirects for a period of time for SE links.

    The following are typical lines in my htaccess file but I still get 404's when trying to access a link to an old page.

    Can anyone please tell me where I'm going wrong?

    Code:
    Redirect permanent index.htm http://www.sewinglines.co.uk/index.html
    Redirect permanent Curtains_and_Soft_Furnishings.htm http://www.sewinglines.co.uk/acatalog/Curtains_and_Soft_Furnishings.html
    Redirect permanent General_Alterations.htm http://www.sewinglines.co.uk/acatalog/General_Alterations.html
    ...
    In the interim I've added the following lines to the end of the htaccess file to at least get temporary 404 redirection to the homepage (which is working).

    Code:
    ErrorDocument 404 /index.html

    #2
    Duncan, could it be the lack of 301, my redirects (now defunct) showed:-

    redirect 301 /acatalog/BAD_TASTE_BEAR_KIRK.html http://prezziesplus.co.uk/BAD_TASTE_BEAR_KIRK.html
    Also, I don't think Google takes very kindly to 404 being redirected, there should be a definite 404 response and then possibly a meta refresh to index, giving time for the spiders to get the 404

    Sorry if I'm stating the obvious, hope it helps.

    Comment


      #3
      Much later... I finally found out that I needed to use RewriteEngine (at least on 1and1 servers). Without this it wouldn't work. For future reference I have the following in my htaccess file:

      Code:
      RewriteEngine on
      RewriteRule ^General_Alterations.htm http://www.sewinglines.co.uk/acatalog/General_Alterations.html [R=301,L]
      RewriteRule ^Curtains_and_Soft_Furnishings.htm http://www.sewinglines.co.uk/acatalog/Curtains_and_Soft_Furnishings.html [R=301,L]
      ....etc
      ErrorDocument 400 /index.html
      ErrorDocument 401 /index.html
      ErrorDocument 403 /index.html
      ErrorDocument 404 /index.html
      ErrorDocument 500 /index.html
      Two interesting points that I found out:
      1. I thought I would need to do a redirect for the old index.htm to the new index.html - this is not the case and in fact causes an endless loop. It seems the extension rewrite change is not required.
      2. I added the errordocument lines as belts and braces which do report 404 etc to the SEs.

      I used this site to check the response headers: http://www.seoconsultants.com/tools/headers.asp

      Comment


        #4
        Originally posted by drounding
        Much later... I finally found out that I needed to use RewriteEngine (at least on 1and1 servers).
        Sorry, overlooked that as I presumed you had that covered, glad you fixed it.

        Comment


          #5
          I thought I would need to do a redirect for the old index.htm to the new index.html - this is not the case and in fact causes an endless loop. It seems the extension rewrite change is not required.
          this is the standard priority thingy.

          if you were to have both an index.html and index.htm , a unix server will show the html. If you want to show the htm you would have to remove the html. As far as unix is concerned its the same thing, it will show which ever one is there - thus no need to redirect

          I think there are designated files that unix will automatically show if they are present - index, default and home - thus if you only type in a folder name ie domain/acatalog to see the page

          if you don't have any of the above you get a folder listing.

          You'll have to search www for the full story on this, I always use index so am no longer sure of the priority of others - I seem to remember in the early pages of FrontPage it used to automatically produce a default page called default (or was it home)?

          Comment


            #6
            I always use index so am no longer sure of the priority of others
            Its a server specification setting.

            In Apache you specify the default delivery filenames in the configuration, and the priority is taken from the order the filenames appear reading left to right.

            In IIS its on the document tab - again priority is controlled by the order the filenames appear in. Change priority by moving a particular filename nearer the top.
            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

            Working...
            X