How to Redirect IP Address to Domain (Apache and Nginx)

Поділитися
Вставка
  • Опубліковано 21 гру 2020
  • Learn how to redirect an IP address to a domain name with Apache htaccess and on Nginx.
    Find more at tonyteaches.tech
    Check out my vlog channel ‪@TonyFlorida‬
    #apache #nginx #redirect
  • Навчання та стиль

КОМЕНТАРІ • 135

  • @samabad95
    @samabad95 2 роки тому +6

    I watched your email server video and now this! You have earned my subscribe! I have been all over youtube trying to figure out how to set this up but I didn't know how to word it! Thank you so much!

  • @datamais
    @datamais 5 місяців тому +1

    Exactly what i nedded

  • @susantosusanto7607
    @susantosusanto7607 2 роки тому +6

    hi tony, how about the opposite. when i enter a domain name, it redirect to ip domain?

  • @hongchaolin9066
    @hongchaolin9066 Рік тому

    Thanks, well works!

  • @brucejongwe4781
    @brucejongwe4781 Рік тому +2

    Thank you very much Sir. How do I do it for an IP address with a port number

  • @golammuktadir4355
    @golammuktadir4355 2 роки тому +2

    Thanks a lot ! both server solution in one place

  • @bitcoinlitcoindogecoinethb9796

    Hello dear boss , can it help in RDNS or PTR for redirect ip to domain if we configure this on apache ???please reply because I m facing some problems for RDNS or PTR

  • @RigoniJr
    @RigoniJr Рік тому

    Hi Tony, very good your videos. Could you teach how we can make two links with two different external ips for a single domain in apache server.

  • @CalpachinoMrcroner
    @CalpachinoMrcroner 9 місяців тому

    Thank you, it worked for me!

  • @salexkorsan8790
    @salexkorsan8790 Рік тому +1

    Brother i have a VPS Server,
    i don't want to install Server Panel, so Should i Do Same Like This ??? for adding Domain.!

  • @ammuvlogs3483
    @ammuvlogs3483 Рік тому

    should we change something in apache conf file?

  • @chung_myung.
    @chung_myung. 3 роки тому +1

    Sir, tq so much. 😍.
    This will be helpful for my new project .

  • @rec-trick
    @rec-trick 5 місяців тому

    we can use httpc in local with django and apache ?

  • @flodvx
    @flodvx Рік тому

    Does redirecting the ip to the DomainName lead to a penalty (duplicate content) in the sight of Google ?

  • @TribaleroDJ
    @TribaleroDJ Рік тому

    Great tutorial, how can i only allow cloudflare to direct ip access?

  • @gopalkothuri2616
    @gopalkothuri2616 Рік тому

    Hii toney for this nginx script we have to buy the domail or we can menction domail in nginx file

  • @champfisk5613
    @champfisk5613 Рік тому

    Hey man this doesn’t work for me. I’m able to get to the site via up, but not domain name. I can ssh with domain name though. Apache2 is the server

  • @Michael-qi6iq
    @Michael-qi6iq 3 роки тому

    thank u sir, very useful

  • @emricsanjuan4028
    @emricsanjuan4028 10 місяців тому

    as sysadd what is main factor to study that sir, thnx to all your videos

  • @DigitalHelpWorld
    @DigitalHelpWorld 2 роки тому

    i used the nano instead of vim and is not working for nginx

  • @kennyaga3859
    @kennyaga3859 4 місяці тому

    Very nice. Thanks

  • @nischalraman4826
    @nischalraman4826 Рік тому

    I need is that website should not be accessed via an IP in apache

  • @wpdas4122
    @wpdas4122 3 роки тому

    Thank you 👍

  • @Syntaxs
    @Syntaxs 3 роки тому

    hey! im switching from VPS to physical. how do i take my domains and point them to my server?

    • @TonyTeachesTech
      @TonyTeachesTech  3 роки тому +1

      In your DNS setting for your domain, change the IP address from your VPS to your physical server

  • @Luukullus
    @Luukullus 2 роки тому

    Thank you :)

  • @imthiyasvm311
    @imthiyasvm311 Рік тому

    how to redirect aws wordpress lightsail static IP to doamin

  • @aabdi_ent8792
    @aabdi_ent8792 2 роки тому

    im living in bangladesh and when im access any website from Pakistan and its price showing in USD$ why it does not showing in pakistani currency? pls help me out. Thanks.

  • @user-cv3er1qj8y
    @user-cv3er1qj8y 2 роки тому

    Thank you~~

  • @ksubrahmanyam7747
    @ksubrahmanyam7747 2 роки тому

    how to open same in angular

  • @ismailakgun97
    @ismailakgun97 3 місяці тому

    bro do a video on windows server with xamp :/

  • @aashayamballi
    @aashayamballi 3 роки тому

    Thank you

  • @zainulabideen_1
    @zainulabideen_1 Рік тому

    thanks

  • @randythamrin5976
    @randythamrin5976 2 роки тому

    if I have an Nginx on my pods, can I redirect my IP address to a domain?
    I run my Nginx on pods, but in deploy or install it in Linux but run the image on pods.
    I was trying to reach the file on the pods by using this command
    #kubectl exec -it nginx-xxxxx -- bin/bash
    I can enter, but cannot do vim or nano there.

  • @adr130590
    @adr130590 2 роки тому

    Hi, do I need to set a static ip in my router or modem ?

  • @riyaone
    @riyaone 2 роки тому +1

    Hi Tony, How to restrict access to IP address in Apache ??
    I dont want someone to access the website by entering the IP address..
    And I'm using Cloudflare..
    I couldn't find how to restrict access to IP address..
    Please Give me a solutions...

    • @TonyTeachesTech
      @TonyTeachesTech  2 роки тому

      Perhaps something like this serverfault.com/questions/842497/disable-direct-ip-access-in-apache/842524

  • @mirzadaniyyaloffical3916
    @mirzadaniyyaloffical3916 Рік тому

    awesome

  • @carsonherman8120
    @carsonherman8120 3 роки тому +2

    how did you add those directory lines in apache?

    • @TonyTeachesTech
      @TonyTeachesTech  3 роки тому +1

      What do you mean?

    • @thathappyguy152
      @thathappyguy152 2 роки тому

      @@TonyTeachesTech I feel like they may be referring to 3:15

    • @TonyTeachesTech
      @TonyTeachesTech  2 роки тому +1

      @@thathappyguy152 Oh I just pasted them from my clipboard. Perhaps you're wondering how to use vim? See this video here ua-cam.com/video/uE4aljoMBeg/v-deo.html

  • @kmilovalle
    @kmilovalle 2 роки тому

    My site is currently ranking most of the pages with both Domain & IP Address. How can I stop ranking with my IP?

    • @TonyTeachesTech
      @TonyTeachesTech  2 роки тому

      If you followed the steps in this video, you have done all you can. Google will eventually see the 301 redirects from IP to domain as it crawls your site. This will take some time... weeks or months even.

  • @chung_myung.
    @chung_myung. 3 роки тому

    Hello sir, I tried this method using local ip and it's working good 🔥.
    Do this method work for public ip also?
    I mean if any other inputs my public static ip do they get redirected as shown?

    • @TonyTeachesTech
      @TonyTeachesTech  3 роки тому

      Yes, this will work for a public IP (that is a public IP in the video)

  • @brandon061033
    @brandon061033 2 роки тому

    Great! But how do you configure/block access with dynamic public address?

    • @TonyTeachesTech
      @TonyTeachesTech  2 роки тому

      That I don't know

    • @brandon061033
      @brandon061033 2 роки тому

      @@TonyTeachesTech Thanks for the reply! Let me clarify. I had a dynamic ip address from my ISP. (DDNS updater has been implemented and will update the name server each time the IP change) My question, how do I implement a similar automation that can update the file setting like in your conf file each time the IP changed?

    • @TonyTeachesTech
      @TonyTeachesTech  2 роки тому

      @@brandon061033 Hi Brandon. I understand what you want to do, but I don't know a solution

  • @eslamsaker1
    @eslamsaker1 3 роки тому

    i tried your steps on google cloud ssh for apache how i cna save things before write wq you said save things ho you do that on ssh?

    • @TonyTeachesTech
      @TonyTeachesTech  3 роки тому +1

      This will help you with the vim text editor ua-cam.com/video/uE4aljoMBeg/v-deo.html

    • @eslamsaker1
      @eslamsaker1 3 роки тому

      @@TonyTeachesTech if you could make video how to migrate wordpress to Google cloud complete including transfer files change things on cloudflare (if my site already pointed to cloud flare what should i dob) make file manger etc

  • @Yo-vv7iy
    @Yo-vv7iy 2 роки тому

    DId the same but i have DNS probe error. Do you know why ?

  • @salexkorsan8790
    @salexkorsan8790 2 роки тому

    Need help, i want ho, self host my website, for connecting apache2 to domain, dns creation is important for this or not ??

    • @TonyTeachesTech
      @TonyTeachesTech  2 роки тому +1

      Yes you will need DNS configuration to access via domain name

    • @salexkorsan8790
      @salexkorsan8790 2 роки тому

      @@TonyTeachesTech thanks darling

  • @indian3960
    @indian3960 3 роки тому

    Hey tony can I redirect my domain to any other domain...
    Ex: Suppose I want to redirect my domain to my youtube or any other social media channel how would I do that? can I do it from my domain registrar DNS settings?

    • @indian3960
      @indian3960 3 роки тому

      and, thanks for making this video ❤

    • @TonyTeachesTech
      @TonyTeachesTech  3 роки тому +1

      Hey! I believe you can redirect a domain name at the DNS level, although I don't have much experience with this: support.google.com/domains/answer/6069273?hl=en
      IMO, a better option would be to handle the redirect with the web server.

    • @indian3960
      @indian3960 3 роки тому

      just need a single WP Plugin :)

  • @lightningboltx422
    @lightningboltx422 Рік тому

    Hello, when i go to my ip after these steps, it redirects me to an att website indicating it could not find the domain. Why would this be happening?

    • @levanfangani57
      @levanfangani57 17 днів тому

      Same problem here did you find any solution?

  • @rafi_45
    @rafi_45 3 роки тому

    can I use this for redirect from http to https in wordpress?

    • @TonyTeachesTech
      @TonyTeachesTech  3 роки тому

      No, but this will help you ua-cam.com/video/gc1MhsJvuRg/v-deo.html

  • @THEROBINKEVIN
    @THEROBINKEVIN 3 роки тому

    Wow 🙏

  • @shahbaaz2958
    @shahbaaz2958 3 роки тому

    Great video. But how do I set up a ip to domain redirect with openlitespeed ?

    • @TonyTeachesTech
      @TonyTeachesTech  3 роки тому

      You can apply these same settings in the OLS control panel

    • @buroq5783
      @buroq5783 2 роки тому +1

      @@TonyTeachesTech Where is the folder of OLS? None under /etc

  • @KeithRainz
    @KeithRainz 3 роки тому

    what about in litespeed?

    • @TonyTeachesTech
      @TonyTeachesTech  3 роки тому

      Although I haven't personally tested it, LiteSpeed supports .htaccess so you can probably use the Apache method

  • @oinkchan1620
    @oinkchan1620 2 роки тому

    can i add ssl certification on redirected domain ?

  • @genghiskha10Century
    @genghiskha10Century 2 роки тому

    If the server is on pvt ip n public ip routed to it then how do u do it?

  • @randomdamian
    @randomdamian 10 місяців тому

    Doesn't work idk wtf the issue is

  • @sokhakho7154
    @sokhakho7154 2 роки тому

    hi tony can you show how to config nginx with .dev domain?

    • @TonyTeachesTech
      @TonyTeachesTech  2 роки тому

      This video will help you with that ua-cam.com/video/QcNBLSSn8Vg/v-deo.html

  • @Shamim_BD
    @Shamim_BD 2 роки тому +1

    How can I find my default config file in Apache?

    • @TonyTeachesTech
      @TonyTeachesTech  2 роки тому

      Usually at /etc/apache2/sites-available/

    • @Shamim_BD
      @Shamim_BD 2 роки тому

      @@TonyTeachesTech was wondeing if you could make a video for Bitnami users!

  • @mortysmith2192
    @mortysmith2192 29 днів тому

    does not work for me unfortunately

  • @augus255
    @augus255 5 місяців тому

    not working in my case

  • @MansoorBarri
    @MansoorBarri 2 роки тому

    I am getting the '500 internal server error' even tho i have copied exactly what you did

    • @TonyTeachesTech
      @TonyTeachesTech  2 роки тому

      Check your logs /var/log/...

    • @MansoorBarri
      @MansoorBarri 2 роки тому

      @@TonyTeachesTech the problem was that i didn't had my ipv6 as DNS record. now its working

  • @rahmanstale
    @rahmanstale 2 роки тому

    How to do that in iis

  • @karlomarkovic3777
    @karlomarkovic3777 3 роки тому

    Is it the same for a raspberry pi?

  • @Istenostor
    @Istenostor 3 роки тому

    Why can it be nessecary?

    • @TonyTeachesTech
      @TonyTeachesTech  3 роки тому

      I got a few requests to make this video from commenters. Not sure how practical this is

  • @pankajbhattarai7210
    @pankajbhattarai7210 2 роки тому

    How to redirect ip:port to domain in nginx?

  • @andyandcallie
    @andyandcallie 3 роки тому +4

    Waaaay over my head. I need software to get rid of nginx.

  • @TripiHJFC
    @TripiHJFC 3 роки тому

    It’s work in Linux too?

    • @freddelarsson4434
      @freddelarsson4434 3 роки тому

      He's doing it in a linux dist. via a VM.

    • @TonyTeachesTech
      @TonyTeachesTech  3 роки тому

      Yes, this will work on Apache and Nginx running on a Linux system

  • @metooidk
    @metooidk 2 роки тому

    but im host on other port.

  • @a99986
    @a99986 Рік тому

    4:24

  • @dom3rry764
    @dom3rry764 3 роки тому

    not working

  • @nikolas8741
    @nikolas8741 3 роки тому

    Hello? I got a question you don't mind if people know your IP?

    • @TonyTeachesTech
      @TonyTeachesTech  3 роки тому +1

      An IP address for a website is public information. Every domain name maps directly to an IP address and is necessary information for users to be able to view your site. So no I don't mind in this case

    • @franciscobrunodias7526
      @franciscobrunodias7526 3 роки тому

      To know some site IP address, just run 'ping somesite.com' and it will return some information about the connection and the IP of somesite.com

    • @gamingshortshisterical
      @gamingshortshisterical 3 роки тому

      @@TonyTeachesTech he was talking about your home IP

  • @Berlinnitro19888
    @Berlinnitro19888 5 місяців тому +1

    script find real ip adress

  • @johnnygotti1568
    @johnnygotti1568 Рік тому

    Tried it, got banned for fraudulent activity. 0/10
    JK nice video. The fraud is probably because I put the wrong IP in nginx

  • @user-rq9ud2yy2w
    @user-rq9ud2yy2w 5 місяців тому

    I'm getting an error " redirected you too many times.
    Try deleting your cookies.
    ERR_TOO_MANY_REDIRECTS"