<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:
    917
    Likes Received:
    120
    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 Hosting Guru

    Messages:
    1,067
    Likes Received:
    162
    Trophy Points:
    63
    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:
    938
    Likes Received:
    277
    Trophy Points:
    63
    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:
    889
    Likes Received:
    247
    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:
    917
    Likes Received:
    120
    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...