Imagine this, you have a file http://www.domain.com/hosting.php and it is indexed by google. But one day you rename the file into http://www.domain.com/myhosting.php. This means that http://www.domain.com/hosting.php does not exist any more. You need to google and your website visitor to go to the new file. The smoothest way to redirect your visitors is to use an .htaccess file. The server checks first for an .htaccess file. So the old page nerver loads, and the visitors are sent directly to the new page.
The code is:
No related posts.












1 comment(s)
Track this comments via RSS 2.0 feed. Feel free to post the comment, or trackback from your web site.
Don’t forget when fixing the homepage issue to redirect the non-www to the www, common SEO mistake.
RewriteEngine On
Options +FollowSymLinks
RewriteCond %{HTTP_HOST} ^domain.com [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]
Any feedback from you?