October 2, 201016 yr Hi, I wonder if anyone can help. I have created a .htaccess file and put the following in it. Then uploaded. But when I input the old url, it shows up and does not redirect to the new url. What have I done wrong? Can anyone advise? Thank you. (the urls are just examples here as I don't want to post my client's site). But the .htm and the .php are the same.Thanks. Redirect 301 /old/old_old.htm /new/http://www.newsite.com/index.php
October 2, 201016 yr Author Hi, I wonder if anyone can help. I have created a .htaccess file and put the following in it. Then uploaded. But when I input the old url, it shows up and does not redirect to the new url. What have I done wrong? Can anyone advise? Thank you. (the urls are just examples here as I don't want to post my client's site). But the .htm and the .php are the same.Thanks. Redirect 301 /old/old_old.htm /new/http://www.newsite.com/index.php'>http://www.newsite.com/index.php'>http://www.newsite.com/index.php P.s I have also tried the following: Redirect 301 old_old.htm http://www.newsite.com/index.php and Redirect 301 /old_old.htm http://www.newsite.com/index.php and Redirect 301 old.htm http://www.newsite.com/index.php and none of that works.
October 2, 201016 yr Author Here's a link to a page that shows you how: 301 redirect Thanks but it's not the whole domain that I need to redirect. The site has been re-designed and I want to redirect all the old pages to the new index page. I was told to do it the way I already put, but that doesn't seem to work so am now wondering if there are reasons for this or if I have done it the wrong way.
October 3, 201016 yr At the start of your htaccess file have this:- RewriteEngine on Options +FollowSymLinks And then Redirect 301 /oldpage.html http://www.totaladdresshere.com/newpage.html Update that and let me know how you get on.
October 4, 201016 yr Author At the start of your htaccess file have this:- RewriteEngine on Options +FollowSymLinks And then Redirect 301 /oldpage.html http://www.totaladdresshere.com/newpage.html Update that and let me know how you get on. Thanks. Yup, did that but still the same. Any other ideas?
October 4, 201016 yr Thanks. Yup, did that but still the same. Any other ideas? Can you post the entire contents of your .htaccess file here and let me know the file is named correctly and you have the rights etc to modify that file on your server and I'll see what might be awry. Thanks.
October 5, 201016 yr Author Can you post the entire contents of your .htaccess file here and let me know the file is named correctly and you have the rights etc to modify that file on your server and I'll see what might be awry. Thanks. I found out from the hosting company that they disallow 301 redirects so i will need to find another way entirely to do the redirection. Thanks for your suggestions anyways.
October 5, 201016 yr The problem, I think with not being able to use .htaccess is the 301 code will not be passed. Resulting in a straightforward redirect as opposed to permanently moved. I found this which is a meta redirect <meta http-equiv="refresh" content="10; url=http://mynewsite.com/"> But the caveat is, apparently it takes 10 seconds to do the redirect – although this can be modified to 0 – and is know as a spam method by search engines, chipping away at your google love. The best alternative would be to redirect using php as you can supply the header to the searchengine for a 301 Redirect Place this before the <html> tag and rename the file with the .php extension: <?php // Permanent redirection header("HTTP/1.1 301 Moved Permanently"); header("Location: http://www.yourdomain.com/yourfile.html"); exit() ?> This will of course be dependent on your support of php (Your server should, if it doesn't, move hosts) and the renaming of the file to redirect to 'filename.php'
October 5, 201016 yr Slightly better way of writing it <?php // Permanent redirection header("HTTP/1.1 301 Moved Permanently"); header("Location: http://www.yourdomain.com/your-redirection-location.html"); exit(); ?>
October 5, 201016 yr Slightly better way of writing it <?php // Permanent redirection header("HTTP/1.1 301 Moved Permanently"); header("Location: http://www.yourdomain.com/your-redirection-location.html"); exit(); ?> Yup- that is your next best bet. I was beginning to wonder why your htaccess wasn't working and I would consider moving your site to another host if you can't use htaccess the way you need to and getting your 301's right is so key.
October 13, 201016 yr Found out from the hosting company that they disallow 301 redirects so i will need to find an additional way completely to do the redirection.
October 21, 201016 yr Sorry I haven't re-replied. Find a new host. I can do your hosting at a low price and don't disallow things necessary for running a good website message me if you'd like to speak more.
October 21, 201016 yr I stumbled on this today.. best 301 resource i have found yet.. may help someone
October 22, 201016 yr RewriteEngine on RewriteCond %{QUERY_STRING} ^id=13$ RewriteRule ^/page.php$ http://www.example.com/newname.htm? [L,R=301]
October 22, 201016 yr I just wondered if you resolved this issue. A permanent 301 in an .htaccess file would be best as a meta redirect could be seen by Google as possibly underhanded. A meta redirect set to the following would work quite happily and may not cause you an issue. It should always be in "lower case" and either this: <meta http-equiv="refresh" content="0; url=http://www.yourdomain.com/index.html"> for doc type strict.dhd <meta http-equiv="refresh" content="0; url=http://www.yourdomain.com/index.html" /> transitional.dhd (i.e />) Used on a standard html file with blank title.
Create an account or sign in to comment