Akses dengan www atau tanpa www kok beda?


Status
Not open for further replies.

yadp

Beginner 1.0
seperti yang saya alami saat ini

web kalau di akses : domainsaya.com tidak ada yang muncul layar putih ngak ada satu titik pun yangmuncul
kecuali kalau diakses dengan www.domainsaya.com (pakai www) baru bisa masuk
Coba di setting CNAME nya Tuan, arahkan sub domain www ke domain anda,,
 

thelor

Beginner 2.0
ikut nimbrung ya pak....
nemu bedanya beginian pak,

===akses tanpa www===
$ curl -I http://namadomain.com/
HTTP/1.1 200 OK
Date: Mon, 07 Apr 2014 14:36:28 GMT
Server: Apache
X-Powered-By: PHP/5.3.28
X-Pingback: http://namadomain.com/xmlrpc.php
Connection: close
Content-Type: text/html; charset=UTF-8

===akses dengan www===
$ curl -I http://www.namadomain.com/
HTTP/1.1 301 Moved Permanently
Date: Mon, 07 Apr 2014 14:36:37 GMT
Server: Apache
X-Powered-By: PHP/5.3.28
X-Pingback: http://namadomain.com/xmlrpc.php
Location: http://namadomain.com/
Connection: close
Content-Type: text/html; charset=UTF-8

problemnya, beberapa waktu lalu pernah ada yang komplen kalau google webmaster tidak akses ke domain yang dengan www tapi domainnya yang lain tanpa www lancar.
menurut saya mungkin karena akses dengan www kena "301 Moved Permanently" jadi google tidak bisa akses.
nah pertanyaannya, ada gak ya cara biar akses www ataupun tanpa www normal (HTTP/1.1 200 OK)?

maturnuwun.....
 

srtider

Poster 1.0
Kalo sy pake htaccess
Code:
# To redirect all users to access the site WITH the 'www.' prefix,
  # (http://example.com/... will be redirected to http://www.example.com/...)
  RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
  RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
 
  # To redirect all users to access the site WITHOUT the 'www.' prefix,
  # (http://www.example.com/... will be redirected to http://example.com/...)
  RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
  RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]
 
Status
Not open for further replies.

Top