Redirecting http://ipaddress to https://domainname on cPanel - redirect

I have a simple yet complicated question for anyone that dares open this question.
I have a cPanel+whm instance provided by AWS. I have a domain name as well associated to it. If i hit the domain name my website pops up. If i hit the ip address my website does not pop up.
So i wrote some redirection rules in the vhosts sections for port 443 and 80.
Now http://domain goes to https://domain
https://ipaddress also goes to https://domain
But, http://ipaddress does NOT go to https://domain
Halp plis.

Related

CIDR notation on Cloudflare for facebook crawler

I'm using cloudflare as CDN provider, unfortunately I'm having issue with the facebook crawler when supposedly someone want to share article from the website and the open graphs don't get loaded properly with message:
Attention Required | cloudflare If you are on personal connection,
like at home, you can run an anti-virus on your device to make sure it
is not infected with malware.
I'm pretty sure this is because I use cloudflare challenge passage to user before accessing the website.
I've read some of the IPs suggestions like on this thread (What's the IP address range of Facebook's Open Graph crawler?), but the problem with cloudflare is that the CIDR notation for acceptable IP Range are only /16 and /24. But the IP list on this thread suggests like:
31.13.24.0/21
31.13.64.0/18
66.220.144.0/20
69.63.176.0/20
69.171.224.0/19
74.119.76.0/22
103.4.96.0/22
173.252.64.0/18
204.15.20.0/22
What I've done so far is to add this list of IPs with notation /24 at the end, but still not working.
Anyone having similar experience like this and know the work around?
I finally able to solve this by adding /16 CIDR notion for each IP range instead. Example: 31.13.24.0/21 => 31.13.0.0/16. Hope it helps others who need it.

Checking user ip address after redirect

As part of a session security feature I am checking $ENV{REMOTE_ADDR} to make sure the users IP is the same during the whole stay on a website.
Some parts of the website show a waiting screen, if for example the rendering of a file takes some seconds, and I redirect the user to a result screen by the use of a meta tag <meta http-equiv="refresh" content="$time; URL=…">.
Unfortunately after this redirect the $ENV{REMOTE_ADDR} variable does not return the users IP but the one from the server.
Is there something I am missing to get this to work properly and/or are there alternatives I could use to redirect the user?
For various reasons htaccess or http-header redirects are not an option and I don't want to use JavaScript for this.
I am already using a 'click me' button to allow the user to manually skipping the wait.
You could try to alter between temporary/permanent type of redirect. Check in server logs, the the http code is 301 or 302?
I misread the accesslogs … it was actually a different script executed on the server, therefore having the servers IP, which caused all this.

Cant change Secure Canvas URL

Simply trying to change the Secure Canvas URL to the SSL one provided by hostgator hatchling account (as described at: "http://support.hostgator.com/articles/ssl-certificates/ssl-setup-use/how-to-make-your-facebook-app-ssl-secure") however when tryin to change the Secure Canvas URL the following erroro happens:
Error
There was a problem saving your changes. Please try again later.
Word on the web is that FB blocked Hostgator public ssls so if this is the case are there any redirect tricks or something before simmply changing domain or getting one of those personal SSL certs... thanks
Copied this from the first comment in the thread on this page: https://developers.facebook.com/bugs/470696239634134/ . It worked for me!
for hostgator shared SSL you have to add the port 443. example: "https://secure123.hostgator.com:443/~username/"

https://url.com becomes https://12.34.56.67/ for no understood reason

On IIS 7 one of our programmers is doing a Response.Redirect to a URL, and it comes back with the resolved IP ADDRESS in the address field.
UPDATE: this is happening BEFORE the response.redirect
Hard code a label as "https://url.com/whatever.aspx"
Display the page with that label
see "https://12.23.45.67/whatever.aspx"
... where 12.23.45.67 is the correct IP for "url.com"
This happens ONLY on the same server as url.com (different app) and ONLY for url.com
"https://test-url.com/whatever.aspx" DOES NOT get altered.
WTF?

Tumblr redirect custom domain - WWW to non-WWW

Tumblr's doc 'Using a custom domain name' is quite helpful it that it clearly states that I need to create an A-record for example.com pointing to 66.6.44.4, so that my website is accessible via example.com.
But I don't understand this: How do I make www.example.com take the user to example.com?
It goes without saying that this needs to be done via DNS, in a Tumblr-compatible way (just in case there are any incompatibilities).
From searching, I read that it's NOT possible to redirect example.com to www.example.com. I can only hope this is NOT true.
If, unfortunately, it happens to be true, my only option is to create a CNAME record pointing www.example.com to domains.tumblr.com - isn't it?
Ah! As stated in this answer, you need to create two DNS entries as such:
A record: pointing example.com to 66.6.44.4
A record: pointing www.example.com to 66.6.44.4
I checked the domain in the answer - emmaraviv.com - apparently, www.emmaraviv.com redirects to emmaraviv.com. So yeah, this is it!
You need to create two records, an A record for the two-level domain (example.com) and another A record for the three-level domain (www.example.com), then add example.com in Tumblr > Settings for your blog, and now example.com should redirect to www.example.com without a hiccup — as far as I can see it.
UPDATE: Just tested this with my blog, and yes, I can confirm that it works!