Read this if you want to access your site with/without 'www'

Discussion in 'Site & Server Administration' started by pesst, Jan 14, 2007.

  1. #1
    Hello, I was wondering how to set .htaccess file for that purpose... now here is my simple tutorial:

    Steps:

    1º) Create a text file named htaccess.txt

    2º) Edit it with the following code:

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^YourSite\.com [nc]
    RewriteRule (.*) http://www.YourSite.com/$1 [R=301,L]


    3º) Change "YourSite" for yours (and .com extension if you are using another one)

    4º) Upload this file to root folder and rename it with .htaccess

    5º) If you already got that file, then just add the code.


    This can be useful :p
     
    pesst, Jan 14, 2007 IP
    Clive likes this.