Jump to content

How to redirect a url without www ?


swatijain2233

Recommended Posts

You can redirect all of the requests for yourdomain.com domain to www.yourdomain.com by modifying your website's .htaccess file. You need to add the following lines at the beginning of the file in order to setup that redirection:

 
1
2
3
RewriteEngine On
RewriteCond %{HTTP_HOST} ^yourdomain.com [NC]
RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [L,R=301]
Link to comment
Share on other sites

You can also use a 301 redirection. 301 redirect is the most efficient and Search Engine Friendly method for webpage redirection. It's not that hard to implement and it should preserve your search engine rankings for that particular page. If you have to change file names or move pages around, it's the safest option. The code "301" is interpreted as "moved permanently".

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...