Membuat Domain Website Joomla Menjadi www

Ada beberapa cara yang bisa digunakan untuk membuat url domain anda menjadi lebih menarik dengan tambahan www didepan nama domain anda. Salah satu nya dengan melakukan sedikit modifikasi pada .htaccess . Pada tutorial ini, yang saya jadi kan contoh adalah, melakukan modifikasi pada .htaccess Joomla Site anda. Untuk cms lainnya anda bisa lakukan hal yang sama, selama anda memiliki file htaccess di hosting anda.

Sebelumnya anda harus yakinkan bahwa file htaccess.txt bawaan asli joomla anda telah di rename/diubah menjadi .htaccess , agar proses redirect ini dapat berjalan sebagai mana mestinya.

Adapun cara-cara melakukan modifikasi pada .htaccess situs joomla anda agar domain website joomla menjadi www adalah sebagai berikut:

1. Masuk CPANEL hosting anda, kemudian masuk ke File Manager.

2. Jika situs Joomla anda berada di root public (PUBLIC_HTML) artinya anda cukup mencari didalam path /home/namauser/public_html/ . Namun jika berada pada direktori / folder lainnya, maka lakukan perubahan di sub directory tersebut atau /home/namauser/public_html/namafolder/ .

3. Cari file .htaccess asli joomla yang sudah anda ubah dari htaccess.txt menjadi .htaccess , dan bukan .htaccess bawaan hosting selagi website masih kosong. Jika ternyata anda belum melakukan hal itu, anda bisa me rename filenya, namun jika ternyata masih tidak bisa, anda bisa lakukan editing pada file .htaccess bawaan hosting anda dengan cara meng copy seluruh isi htaccess.txt joomla anda ke dalam .htaccess hosting anda.

4. Dari daftar urutan script .htaccess joomla default anda akan melihat script nya sebagai berikut:

##
# @version $Id: htaccess.txt 13415 2009-11-03 15:53:25Z ian $
# @package Joomla
# @copyright Copyright (C) 2005 – 2008 Open Source Matters. All rights reserved.
# @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
# Joomla! is Free Software
##

#####################################################
#  READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE
#
# The line just below this section: ‘Options +FollowSymLinks’ may cause problems
# with some server configurations.  It is required for use of mod_rewrite, but may already
# be set by your server administrator in a way that dissallows changing it in
# your .htaccess file.  If using it causes your server to error out, comment it out (add # to
# beginning of line), reload your site in your browser and test your sef url’s.  If they work,
# it has been set by your server administrator and you do not need it set here.
#
#####################################################

##  Can be commented out if causes errors, see notes above.
Options +FollowSymLinks

#
#  mod_rewrite in use

########## Begin – Rewrite rules to block out some common exploits
## If you experience problems on your site block out the operations listed below
## This attempts to block the most common type of exploit `attempts` to Joomla!
#
## Deny access to extension xml files (uncomment out to activate)
#<Files ~ “\.xml$”>
#Order allow,deny
#Deny from all
#Satisfy all
#</Files>
## End of deny access to extension xml files
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
# Block out any script trying to base64_encode crap to send via URL
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
# Block out any script that includes a <script> tag in URL
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Send all blocked request to homepage with 403 Forbidden error!
RewriteRule ^(.*)$ index.php [F,L]
#
########## End – Rewrite rules to block out some common exploits

#  Uncomment following line if your webserver’s URL
#  is not directly related to physical file paths.
#  Update Your Joomla! Directory (just / for root)

# RewriteBase /

########## Begin – Joomla! core SEF Section
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/index.php
RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$  [NC]
RewriteRule (.*) index.php
RewriteRule .* – [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
#
########## End – Joomla! core SEF Section

5. Insert code berikut setelah bagian yang di warnai dengan tinta biru. (#  mod_rewrite in use)

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

RewriteCond %{HTTP_HOST} !^.*NamaDomain.com [NC]
RewriteRule (.*) http://www.NamaDomain.com/$1 [R=301,L]

6. Sehingga file .htaccess anda menjadi seperti berikut ini.

##
# @version $Id: htaccess.txt 13415 2009-11-03 15:53:25Z ian $
# @package Joomla
# @copyright Copyright (C) 2005 – 2008 Open Source Matters. All rights reserved.
# @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
# Joomla! is Free Software
##

#####################################################
#  READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE
#
# The line just below this section: ‘Options +FollowSymLinks’ may cause problems
# with some server configurations.  It is required for use of mod_rewrite, but may already
# be set by your server administrator in a way that dissallows changing it in
# your .htaccess file.  If using it causes your server to error out, comment it out (add # to
# beginning of line), reload your site in your browser and test your sef url’s.  If they work,
# it has been set by your server administrator and you do not need it set here.
#
#####################################################

##  Can be commented out if causes errors, see notes above.
Options +FollowSymLinks

#
#  mod_rewrite in use

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

RewriteCond %{HTTP_HOST} !^.*NamaDomain.com [NC]
RewriteRule (.*) http://www.NamaDomain.com/$1 [R=301,L]

########## Begin – Rewrite rules to block out some common exploits
## If you experience problems on your site block out the operations listed below
## This attempts to block the most common type of exploit `attempts` to Joomla!
#
## Deny access to extension xml files (uncomment out to activate)
#<Files ~ “\.xml$”>
#Order allow,deny
#Deny from all
#Satisfy all
#</Files>
## End of deny access to extension xml files
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
# Block out any script trying to base64_encode crap to send via URL
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
# Block out any script that includes a <script> tag in URL
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Send all blocked request to homepage with 403 Forbidden error!
RewriteRule ^(.*)$ index.php [F,L]
#
########## End – Rewrite rules to block out some common exploits

#  Uncomment following line if your webserver’s URL
#  is not directly related to physical file paths.
#  Update Your Joomla! Directory (just / for root)

# RewriteBase /

########## Begin – Joomla! core SEF Section
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/index.php
RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$  [NC]
RewriteRule (.*) index.php
RewriteRule .* – [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
#
########## End – Joomla! core SEF Section

Ganti tulisan ” NamaDomain.com ” dengan nama domain anda sendiri. Setelah selesai, jangan lupa simpan filenya, dan sekarang silahkan anda coba untuk mengakses domain anda tanpa menggunakan www.

Jejaring Sosial buatan Indonesia di Beli Yahoo
http://kowek.web.id/