On Page 301 redirect for html pages
-
For php pages youve got
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://www.example.com" );
?>Is there anything for html pages? Other then
Or is placing this code redirect 301 /old/old.htm http://www.you.com/new.php in the .htaccess the only way to properly 301 redirect html pages?
Thanks!
-
This post is deleted! -
My vote gose to the htaccess any time all the time.
It's global, you can add all the rewrite rules within the same global file.
Is just my opinion.
-
Just make sure not to use this for a whole ton of 301 redirects. If it is a big enough redirect project using PHP might be the way to go.
-
I have a lot (100+) of 301 redirects to do for .html pages, is the .htaccess the only way to go?
Thanks
-
I am suprised no one is recommending using the httpd.conf file. It functions the same as the.htaccess file except it is much more efficient because it is loaded into the servers memory which means the file is opened & read once. With an .htaccess file the server reads the file on every request.
Also, if PHP is enabled on the server you can use php code in html pages. There is a php or server setting where you can say read html pages as php.
-
Yeah - htaccess is the way to go for rewrite rules. Check out http://www.seomoz.org/learn-seo/redirection for more depth/detail, too.