AWS Wordpress site accessible using both domain and public IP. How to disable? - wordpress

My wordpress site is accessible from both the IP address and the domain name.
https://example.com and IP
How to redirect IP address to domain name?
The IP address is also indexed on Google.
Installed using Bitnami marketplace on AWS

It seems this have been discussed on bitnami community: https://community.bitnami.com/t/how-to-block-access-ip/61773
Credits to user Jota (Bitnami Engineer):
You need to made 3 changes in the solution to make it work with the
domain only:
Change the WordPress configuration file to use your domain
https://docs.bitnami.com/aws/apps/wordpress/administration/configure-domain/
Change the WP database to use that domain
https://docs.bitnami.com/aws/apps/wordpress/administration/update-ip-hostname/ (*)
Change Apache to redirect all the requests to your domain
https://docs.bitnami.com/aws/apps/wordpress/administration/use-single-domain/
(*) This link do not work right now. But this topic is discussed here:
https://community.bitnami.com/t/only-use-dns-name-for-the-website-rather-its-ip-address-for-security/85944

Related

How to host the main domain and subdomains at 2 different hosting sites from godaddy?

I have bought the domain from godaddy.
And I have designed the UI which is the main site hosted at say webflow or wordpress.
Now I want to host the dashboard of the main site to the subdomain of this main site from heroku.
How to achieve that?
Domain bought: goDaddy
main site: abcd.com
sub domain: dashboard.abcd.com
main site hosted at: wordpress
sub domain hosted at: abcd.herokuapp.com
Now I want to change the subdomain abcd.herokuapp.com to dashboard.abcd.com
I tried creating an 'A' record at goDaddy DNS settings for dashboard.abcd.com but it wants me to enter an IP address of heroku but when I created a DNS Zone in Heroku for dashboard.abcd.com, it doesn't seem to provide an IP address. It only provides the DNS Target value.
I laso tried to put the abcd.herokuapp.com in Goddaddy dns settings in Points To field but it doen't accpets it. It requires an IP address.
Heroku uses dynamic IP address for the dynos so it’s impossible for Heroku to provide an IP address instead it provides a DNS target. Unfortunately GoDaddy doesn’t support ALIAS/ANAME records. You might want to check out other DNS providers who support ALIAS/ANAME out of the box to configure the APEX domain.

Point a url to another ip

I have a small website hosted in aws server. I do not want to write a blog engine so I want to use wordpress in cpanel.
Lets say my blogs will show up in domain/blogs url. will it be possible to somehow show the blogs from the wp cpanel when user visits that url and if the user only visits domain.com then they shud be in the aws server.
It seems that you want to keep the website with AWS and host your blog with any other provider.
You can do that via creating the subdomain like blog.domain.com.
1.Get Wordpress hosting with blog.domainname.com and your web host will provide the IP address of their web server.
2.Just go to DNS manager of your domain and add following A record.
blog.domain.com >> webhost's given IP address.

How do I point my domain to my website that's hosted on an AWS EC2?

The registrar for my domain is godaddy, I go to their DNS records section and I changed the A name to the elastic IP associated with my instance. Now when I type my domain in the browser, my website appears! However, it forwards it to the IP of my server.
Things I've tried (whether logical or not):
I'm using wordpress multsite so I changed the DOMAIN_CURRENT_SITE in wp-config.php to my new domain. No luck. Reverted.
I changed the 'site_url' and 'home' in my database to point to my domain. No luck. Tried one at a time etc. Reverted.
Changed ServerName to my new domain in httpd.conf (apache).
sudo hostname www.... (don't know what that does)
So I'd like to simply have my website open without it showing the IP in the address bar. Can someone help?
Thanks
EDIT:
Here's the DNS page of godaddy, I've blanked out the ip in the A records, but it's just the ip of my server.
First you need to set Custom NS in godaddy with AWS dedicated IPs then set them as DNS. If you are using Linux instance with cPanel then just add the domain in cpanel's addon-domain.
If you are using Windows instance then you should configure IIS.

How to connect domain to WordPress on Google Compute Engine

I already own a domain from BigRock.in
And I've deployed WordPress on Google Compute Engine (GCE)
I want to connect this domain to my WordPress installation. How do I do that?
And also if it's possible to connect domain to my WordPress installation, how to create subdomains on GCE?
Domains and subdomains are controlled via DNS. You need to make the DNS record for bigrock.in, www.bigrock.in or whatever other subdomain you want point to you GCE instance's IP address.
If you want different subdomains to show different sites you will need to set up virtualhosts in your HTTP server (or perhaps use a Wordpress plugin).

Connecting Amazon Web Services with Elastic IP

Right now I have a domain ex: foobar.com hosted on Bluehost.
I created an instance on AWS and fortunately, I used (wordpress by bitnami) to migrate my foobar.com to the aws site.
I created an elastic ip and associated it with my instance.
This is where I am stuck. I've read tons of tutorials telling me to go into my Bluehost and add a DNS record which I haved.
My first attempt was to do a URL redirect on foobar.com, which worked but only for the homepage because when I would navigate to another page, it would display the elastic ip (ex: 53.13.153.12/about).
I am unsure how to go about this problem.
Setup an A Record, not a URL redirect. You'll need to then configure the vhost on your server to understand that domain (I think you may have already done this step).
Bluehost has some documentation here

Resources