<Ask> Cara Disable Akses dari IP Server

Discussion in 'Domain Name' started by Pencari_Ilmu, 10 Nov 2015.

Thread Status:
Not open for further replies.
  1. Pencari_Ilmu

    Pencari_Ilmu Expert 2.0

    Messages:
    825
    Likes Received:
    109
    Trophy Points:
    43
    Selamat Sore tuan,

    Kebetulan habis install joomla di server, domain sudah dipointing ke IP, yang ingin saya tanyakan adalah gimana caranya agar website hanya bisa dibuka via alamat domain abc.com dan meredirect IP ke domain ketika ada yang akses via IP server. Apa harus ditambahka kode tertentu di .htaccess nya?

    Dulu pernah bisa, tapi karena jarang praktek jadinya lupa :-(

    Terima kasih,
     
  2. mas.satriyo

    mas.satriyo Expert 2.0

    Messages:
    953
    Likes Received:
    138
    Trophy Points:
    43
    kalo nginx bisa pake ini

    buka config file default host (/etc/nginx/sites-enabled/default)
    tambahkan
    Code:
    return 301 http://maindomain.com
    
    di bawah listen default_server

    contoh :
    Code:
    server {
      listen 80 default_server;
      listen [::]:80 default_server;
      return 301 http://satriyowibowo.my.id;
    
     
    Pencari_Ilmu likes this.
  3. masiqbal

    masiqbal Expert 2.0

    Messages:
    863
    Likes Received:
    249
    Trophy Points:
    43
    kalau pakai Apache .htaccess coba diisi begini (misal IP anda adalah 123.123.123.123):

    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^123\.123\.123\.123
    RewriteRule (.*) http://domainanda.com/$1 [R=301,L]
     
    Pencari_Ilmu likes this.
  4. IDreg.Net

    IDreg.Net Expert 2.0 Web Hosting (Company)

    Messages:
    818
    Likes Received:
    226
    Trophy Points:
    43
    tinggal masukan di .htaccess yg disebutkan mastah diatas
    atau langsung melalui menu cpanel redirect jg bisa

    mungkin lebih tepat judulnya redirect IP ke Nama Domain :D
     
  5. Pencari_Ilmu

    Pencari_Ilmu Expert 2.0

    Messages:
    825
    Likes Received:
    109
    Trophy Points:
    43
    Ups :)

    terima kasih tuan, sudah dipraktekkan dan berhasil, kebetulan memang pakai apache :)
     
Loading...
Thread Status:
Not open for further replies.

Share This Page

Loading...