General Community > HTML/CSS

301 Redirect .htacces

<< < (3/3)

floridaflatlander:

--- Quote from: floridaflatlander on May 12, 2011, 02:08:13 PM ---The code is finished
here it is ---------
# below added 2-25-11
Redirect 301 /file.html http://www.mynewwebsite.com/boats.php
Redirect 301 /file.html http://www.mynewwebsite.com/fishing.php
--------------------------- thats' it

--- End quote ---

Use the above in your htaccess or

It may be easier to do as buster... said, leave the files you want to remove on your web site and add the php code he stated at the top of the file before anything else. Your old files will act as a holder for your redirect code.

Play with it, if the files aren't php you may have to use your htaccess

busterone:

--- Quote from: sikkens1997 on May 13, 2011, 10:06:11 AM ---
--- Quote from: busterone on May 12, 2011, 10:27:47 PM ---An alternate way would be to place the following code in an index.php file on your old domain. It will redirect to your new domain.

--- Code: ---<?php
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://yournewdomainhere" );
?>
--- End code ---

--- End quote ---
If you would have read it, domain name stays the same. The pages are changing. Please read before posting?

--- End quote ---
Yes, I see. If you are simply moving your site from one host to another, you do not need any 301 redirects. Google and other search engines will find  your site easy enough once the DNS is propagated.  301 redirects are for pages that have been moved to another domain or a subdomain. Using 301's will have no bearing whatsoever on SEO.

Navigation

[0] Message Index

[*] Previous page

Go to full version