I'm hosting my own website on my personal server running Ubuntu server. My public IP address is showing up in the status bar each time someone visits my sites or hovers over one of the links on the pages (i.e. when going to the home page it says waiting for myipaddress/index.php). I have purchased a domain name with godaddy. While I was able to find the option of mask the url in the address bar in the admin page, I was able to find no such option for the status page. Initially, I tried to embed JavaScript code into the php files but I later learnt from various posts (link) that we cannot control what is displayed in the status bar .
All I want to do is to display my domain name instead of my IP address each time the page loads and each time the user hover's over a link. Any ideas of how I should go about this?
You should just have your domain name point to your IP address and setup the site on your server to handle that domain. Then all requests will go to that domain name instead of directly to your IP address.
Note: it's very easy to find the IP address for any web server (based on a domain name) so you can't really hide it, but you can set it up so that it behaves just like any regular site that uses a domain name instead of an IP address.
Have you done anything to connect the webserver and the domain name? You're going to need name servers, often your domain provider will have something you can use, or you can run your own. The name server is like a phone book for websites. It says mydomain.com can be found at IP address 123.whatever. Until you have an entry in a name server 'phone book' you will not be able to access it through that domain name.
You'll also need to setup something on the webserver so it will know what to serve when it gets a request pointed to that domain, if you're using apache, likely it will be a virtual host entry in the appropriate config file.
Related
How to check if user is visiting site from our own local network or common internet.
Suppose, If somebody scans the qr code in our restaurant, it links to something, which is checking, are you connected to the local network or you're opening it from global? (no idea how)
Local - redirecting to the local domain (no idea how i can do this also, eg. restaurant.menu)
Global - redirecting to the global domain (eg. menu.com)
You can check the IP of the customer and compare it with IP range of your network. If the customer IP falls in your range redirect the user to local site otherwise to your global site.
You can use $_SERVER['REMOTE_ADDR']; to get IP of user visiting the site from the QR code.
You can setup a dns record for your local IP (external IP). The IPs mentioned in the comment 10.100.109.10-256 are private IPs and not publicly accessible. These wont work, search on google with what is my ip and I am sure you will get many options.
Once done you can create a script which will get user ip address ($_SERVER['REMOTE_ADDR'];) and do a gethostbyaddr() lookup to get the hostname associated with that IP. If the hostname matches the one you have set, your visitor is from a local connection.
For the redirection to work, if your website is hosted on server that is not in the same network as your router then you need to have a public facing domain name (ie. restaurant.menu should be reachable publicly)
A second approach could be to redirect the traffic at the router level. If your router allows you can setup a redirection in the router itself. If it does not you will need to setup a dns server. In this dns server you will specify the desired (local) IP address for the domain. You router needs to have a backup dns to keep resolving other domains.
These are hacks but if implemented correctly they will provide very predictable results.
I am working on a WordPress website and have the plugin WP Security installed. It tells me the current IP Address I am on when viewing the website. However the IP address it is producing isn't my correct IP address. I did the same thing on another WordPress website and it did produce the correct IP address.
The reason I'm trying to figure out the IP address is because someone entered their login credentials wrong 5 times. The website is set up so when that happens it locks that person out of website for an hour. Well when this happened it didn't just block their IP address, but blocked our IP address and the clients IP address. And the IP address it said it was blocking was neither of ours.
What could be the reasoning for this single website to be grabbing the incorrect IP address and believing it belongs to us and our client?
EDIT: after looking into it a little more the IP address that is showing up on this website is through Liquid Web, our hosting provider. So it is showing that IP address instead of our current/local IP address.
"All" traffic is routed to your webserver via another server (CDN, Firewall, Nginx etc). Following a failed login attempt the WP plugin is blacklisting this intermediate servers IP address locking everyone out.
Typically php scripts gets the visitors IP frome the REMOTE_ADDR environment variable: but depending on configuration with e.g. intermediate Nginx server REMOTE_ADDR may contain the nginx server IP; and the "real visitor" IP may be in HTTP_X_REAL_IP
You can use this script to: check which environment variable on your site contains the actual visitor IP.
It would be useful if you provided the link to the site from which you got the WP Security plugin.
Solution:
Ask your host provider to configure servers so REMOTE_ADDR on your web server will contain visitors IP; or
If you know which environment var is valid (above); then the security plugin may have a setting to configure accordingly; or
Report as a bug on plugins support forum.
i am accessing my wamp server from WAN through PC's IP address 122.xxx.xxx.xx. but now i want to access my wamp through DOMAIN name.
i only have my domain name and no other credentials for setting. is it possible with domain name?
You need to point your domain name at that ip address. In your settings or admin panel where you setup/purchased your domain name set the ip address to the 122.xxx.xxx.xx you have been using.
This really depends upon your location.
If when you reboot your router you get a new WAN IP address every time, then you cannot use the domain name you have purchased. You would have to use a Dynamic DNS provider like DYNDNS.COM or Amnon's suggestion DNSEXIT.COM or one of the others that provide this service. With that service you will unfortunately have to use one of their sudo domain names, which means you will have to use something like YOURDOMAIN.ONE_OF_THEIR_DOMAINS.ONE_OF_THEIR_TLDS, so it would look like mydomain.dyndns.net they normally have quite a few to choose from, but it wont look like www.yourdomain.com
If you always have the same WAN IP address for your router then you can use you purchased domain name. You will have to contact whoever you purchased it from, they would normally provide a web site where you can login and set the ip address you want to use for the domain name you have purchased. Once that is done and you give the DNS servers a few minutes to a few hours to get updated you will be able to use that domain name.
I have a site using PHP and MySQL. I have a domain name reserved by a domain name provider. I do not want to use the storage proposed by that provider to store my files, because it's really too expensive.
Let's say the domain name is : www.domainname.com
So... If I choose another provider (let's imagine it's free.fr) to store my site's files, what may I do, or what may I look for, to be able to have in my url bar :
http://www.domainname.com/onefolder/onegreatfile.php
instead of :
http://imhere.free.fr/innerfreefrfolder/onefolder/onegreatfile.php
If I activate the transparent redirection on my domain name, the url keeps being :
http://www.domainname.com
If I force the url bar to go to http://www.domainname.com/onefolder/onegreatfile.php
it returns a 404 not found error (The requested URL /onefolder/onegreatfile.php was not found on this server.)
The following is an oversimplification but it should be enough to get you where you need to go:
You'll want to sign up with a web host that allows you to use your domain name with their server. They will tell you what to set your name servers to so that any requests for www.domainname.com will result in the ip address of the server your files are stored on. Setting the name servers for your domain is usually done via a service provided by your registrar.
The transparent redirection you're referring to (some hosting sites call it Forwarding with Masking) is really just your hosted files displaying within an iframe on your owned domain name.
What you really need to look into is setting the DNS servers/Nameservers for your domain name to point to your hosted website/IP address.
My application running on amazon cloud server. when i navigate to various pages the URL remains my domain name . www.mydomain.com while when I navigate through ip binded for that domain it work fine, and when i am running the same application locally on XAMPP server then also it works fine.
I have binded my domain name with the ip of my server.
Can u guess the problem and describe the solution to me?
Due to this problem when user refreshes the page through browser by clicking on refresh button then always the home opens
Please check the configuration of your domain at your registrar.
Some registrars offer a "framing" or "web redirection" service in addition to a DNS service. The behavior you have described makes it sound like you're using one of those services instead of having correct DNS records.