Skip navigation
Currently Being Moderated

Redirecting urls

Nov 1, 2013 5:18 AM

Hi All,

I've set up an account with Google Webmaster and its showing that  have 21 crawling errors on the site that i have added. All errors listed are pages that are no longer in use as they have been replaced and have been removed from server. Would the best thing for me to do with this problem be to add some code to a 'htaccess.txt' file like below? I have never redirected pages before so i just wanted to make sure i am doing it correctly.

 

Also this domain name is on a server package where there are more than one domain names. There is currently a 'htaccess.txt' file present within a different directory, should i just add this code to that file or create another 'htaccess.txt' file in Dreamweaver and upload it to the directory of the this domain name (www.milesfunerals.com)? Basically what i am asking is, can i have more than one 'htaccess.txt' file on my server?

 

 

Redirect 301 /memorials.html http://www.milesfunerals.com/memorials.php

Redirect 301 /whychooseMD.html http://www.milesfunerals.com/whychooseMD.php



 


 
Replies
  • Currently Being Moderated
    Nov 1, 2013 5:32 AM   in reply to Ness_quick

    Your .htaccess file needs to be in the root of your server's website — at least for standard Linux/Apache.

     

    The very first thing you need to do is to create a 404 page. It should contain complete site navigation, so it should be based on your master template for your website or it should be a page just like the rest of your pages with all of your header/footer information as well as complete navigation to the real pages on your website.

     

    I tend to call mine 404.html (but, if you are using php or server-side code, you will need to use the correct extension for your website).

     

    In your .htaccess file, you need to put the following line:

     

    ErrorDocument 404 http://www.yoursite.com/404.html

     

    Save and upload that .htaccess file to the root of your site.

     

    In the site where I knew there were inbound links I could not control, I put the following text:

     

    <h1>The page you were looking for is not here</h1><br />

           <p>Companyname frequently updates pages and you may have arrived at this one in error. Our complete navigation is above and we would like to help you find your way. Please review the navigation and we'll take you right where you want to go.</p>

     

    Then, I followed that with the material that is on the home page for the website (index.html)

     

    After that, I would do my .htaccess redirects.

     

    For a complete listing of how to do that, please follow this link: http://www.htaccessredirect.co.uk/

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 1, 2013 5:53 AM   in reply to Ness_quick

    Ness_quick wrote:

     

     

     

    Redirect 301 /memorials.html http://www.milesfunerals.com/memorials.php

    Redirect 301 /whychooseMD.html http://www.milesfunerals.com/whychooseMD.php



     


    Yes as you have shown above. Not sure about where your htaccess file should be located given you have a package which shares domains but leave it where it is and insert the above.

     

    Then in the browser type in the path to memorials.html and see if it goes to http://www.milesfunerals.com/memorials.php

     

    If it does the htaccess file is in the right location, if it don't it's not.

     

    And deploy  'mhollis55' 404 error page suggestion to sweep up any other pages which in future may change location or be deleted.

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 1, 2013 6:33 AM   in reply to Ness_quick

    The file must be named .htaccess and not .htaccess.txt.

     

    As to exactly where it goes, you may need to ask your hosting provider.

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 1, 2013 6:37 AM   in reply to Ness_quick

    Ness_quick wrote:

     

    Ok so i uploaded the new htaccess.txt file to the directory of the domain name of the site and tried the pages in the browser to see if they now redirect but still getting the 404 page. Perhaps its something that doesn't work straight away. I'll wait for a bit then i'll try adding the same code to the original htaccess file of the package root directory, maybe that will work.

     

    I think when I tried it some time ago the 301 redirect didn't work instantaneously......check again. Obviously if the 404 ErrorDocument is working the htaccess file IS in the correct loaction.

     

    Also it may be that the ErrorDocument 404 http://www.yoursite.com/404.html needs to come after the 301 listings

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 1, 2013 1:23 PM   in reply to Ness_quick

    Do let us know if you want a hosting provider that will support you. Sounds like Fasthosts Internet Limited is not a hosting provider who cares about support.

     

    -Mark

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 1, 2013 1:50 PM   in reply to Ness_quick

    Ness_quick wrote:

    I will simply apply a customised 404 page so that in the small chance that anyone does come across these urls they will be given a polite message and some options linking them back to the site as mhollis55 suggested earlier.

     

    If you're going to create these custom 404 pages, you could just add a blank page in it's place with a header redirect sending them to the correct URL:

     

    in memorials.html

    <META http-equiv="refresh" content="1;URL='http://www.milesfunerals.com/memorials.php'">

     

    It's worth nothing as well that you could avoid this situation in the future by using folders to separate content instead of separate filenames. Eg. memorials could be in a folder "memorials" which has an index file inside. That way the URL would be http://www.milesfunerals.com/memorials (no file extension). You would then just replace the HTML file when using a PHP file.

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 1, 2013 2:34 PM   in reply to Ness_quick

    Ness_quick wrote:

     

    What a complete nightmare and total waste of time!!! I have just spent all afternoon in a live chat with my hosting provider trying to get the 301 redirect to work. The whole conversation just went round and round in circles. They dont actually listen to a thing you tell them. I must have explained the same thing at least 5 times and then they ask me a question that i had just explained previously, so i give up!! I will simply apply a customised 404 page so that in the small chance that anyone does come across these urls they will be given a polite message and some options linking them back to the site as mhollis55 suggested earlier.

     

    Ok i think i feel a little better now that i've got that off my chest.

     

    Sounds a bit of a pain.

     

    Maybe their servers are incorrectly set up to deal with 301 redirects.

     

    I always have alternative servers to check on. If it works on one and not the other then I can go back to the host it doesn't work on and kick asssssss.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points