Jika Anda sudah pernah membaca tulisan saya berjudul Meredirect URL Tanpa www ke URL Dengan www Menggunakan File .htaccess mengenai bagiamana cara untuk me-redirect URL dari suatu situs yang alamatnya diketik oleh pengunjung tanpa diawali dengan www menjadi alamat URL yang diawali dengan www, maka skrip redirect tersebut tidak akan berguna sama sekali. Sebagai contoh, domain utama untuk situs Anda adalah mydomain.com, maka dengan menggunakan skrip redirect tadi, jika Anda memiliki subdomain, sebagai contoh, mysubdomain.mydomain.com di mana sub direktori dari mysubdomain ini berada di bawah direktori utama dari situs Anda mydomain.com, maka URL tersebut akan dikonversi menjadi: http://www.mydomain.com/mysubdomain/. Tentu saja hal ini tidak kita harapkan bukan? Lalu bagaimana solusinya?
Begini solusinya. Jika Anda menggunakan skrip redirect tadi, maka Anda sebaiknya menghapus kode redirect tersebut dari dalam file .htaccess supaya URL dari situs subdomain tersebut ditampilkan sebagaimana mestinya menjadi http://mysubdomain.mydomain.com. Dengan kata lain, jika Anda telah menggunakan subdomain, maka Anda harus mempertimbangkan kembali untuk menggunakan skrip redirect tadi jika alamat URL dari subdomain situs Anda tidak berubah seperti di atas.
Saya mengetahui mengenai hal ini ketika membuat sebuah subdomain untuk situs saya yang lainnya. Semoga informasi ini bermanfaat bagi Anda.

This is only test for implementing SI Captcha Plugin for my website. Bye bye spam!
Nice post. Your information is so useful. thanks. I come across your web today, I find it so good, I will pay attention to your web from today.
Very useful info… I read both the articles (this one and the one that talks about “Redirecting URL Without www to URL With www Using .htaccess File”)
* so in your experience, what is the combined solution. One that redirects URL with www to URL with www and also allows subdomain on the website?
* According to the the following URL, you should never use .htaccess files unless you don’t have access to the main server configuration file.
http://httpd.apache.org/docs/2.0/howto/htaccess.html
Any comments based on your experience?
Thanks!
@Dilip Shah
* Well, the best solution is by using WordPress! LoL. Sounds like an advertising, huh? But it does not. WordPress has the ability to automatically redirect to the fixed URL that we define in Settings -> General in its admin page without having to define explicitly in the .htaccess file. For example, a visitor type in his browser this URL: h++p://mywebsite.com, but because of the URL settings in that site that using WordPress has been defined as: h++p://www.mywebsite.com, then that visitor will be automatically redirected to the correct URL: h++p://www.mywebsite.com.
* That’s right. I agree with that article, especially for that reason. That’s why I always choose WordPress each time I create my another new website. WordPress is the best CMS I ever used until now.
You’re welcome.
how to redirct url without www to url with www
for example :- http://example.com/index1.html to http://www.example.com/index1.html
Help me