Should I allow viewing my website by entering the IP in url bar - apache

Should I allow viewing my website by entering the IP in url bar? that means that instead of writing site.com in the browser, I write the IP of the website.
Example:
this IP 85.17.159.246 is not accessible if you put it in the browser bar. But the website hosted by it azlyrics.com is available.
Google on the hand allows viewing its website via direct IP, for example if you use 64.233.165.190 in your browser it will show Google's website.
Is it bad to allow that? Is it good? Why?
In the past I've read that it is not a good idea to allow this, but now I really don't know how to search for this, as all the results on Google return with irrlevant pages.
If it is not a good idea, how can I block it? (without blocking the website url, of course)

We do have domain names for a reason, it brings several nice benefits as being able to move your site to a new IP but keeping the same domain name. Also when using domain names you can have multiple websites on a single IP.

It's not bad. But an IP can only "host" one site. This works for Google, since they'd only be serving up google.com content anyways. But consider a shared server with (say) 50 different sites on it.
When you punch in http://example.com, your browser will hit example.com's IP and include a Host: example.com in the request's HTTP headers. That lets the server identify which of its sites you're requesting.
But if you hit the server's IP directly, there's no Host: header, and now Apache has no idea which of the sites you really want.

Related

Visitor's IP not getting forwarded in www-version of the domain

I have a site where I am loading country-based dynamic contents. While Laravel's Request::ip() gets the proper(original) client IP if user visits the domain.com version, www.domain.com version gets the same IP for all visitors. I suppose it's the NS resolver server somewhere or something I am not aware of.
Is there a way to set the www version with redirects or something else so that $_SERVER['X-Forwarded-For'] or $_SERVER['HTTP_X_FORWARDED_FOR'] or $_SERVER['REMOTE_ADDR'] gets the original client's IP? It's a Cpanel, so I don't have all the independence on all the DNS components to forward everything as per my need with custom Apache or Nginx setup. I just need a bypass, so to speak, if any.
It is generally a bad setup if you allow clints to access a website with two different URLs i.e. www and non-www. This is because Google sees these as two different websites and logs stats for them separately. This is of course not ideal if you want good SEO. You should re-direct all clients to one URL, choose either www or non-www.
To achieve this you can create a redirect rule in your server configuration files.

How to let google know i'm the verified owner of 3 websites running with same content

I have 3 e-commerce websites having same contents on it,the domain name is same but the extensions of all domain is different.How to inform google that i'm the verified owner of all domains.
I just wanted to let google know and seek permission to use same content is different websites of mine, so that it wouldn't affect my ranking.
Is there any code by putting which on the 3 sites, google will got to know that these same sites are of one company's????
By "the Domain name is the same but the extensions are different" i guess you mean you have example.com, example.net, example.io.
if this is what you mean, these are considered to be three different domains. you should implement canonical urls including the preffered domain or redirect all traffic to what you consider the main domain. (e.g. redirect traffic from example.net and example.io to example.com)
For each domain you should use a txt recod to verify ownerhsip in the webmaster tools, most domain providers allow you to configure this record for each domain on your own. Log into your account at your domain provider's site and search for DNS Management, Name Server Management, Control Panel, or Advanced Settings.
Then again, many CMS or e-Commerce systems support "website aliases", where you can configure your system to answer to different domain names, when all your domains point to the same server and often allow you to configure a canonical domain, so that you may even not need to run 3 identical websites.
Please specify your setup, there is not much to go on here. A good example would be:
I currently run 3 Websites (example.com, example.net,
example.io)(Drupal) on 3 Servers, each has its own domain but they
have identical content. They do not use a shared database.

Redirect all traffic to holding page unless logged in using .htaccess

I currently have a landing page setup on my domain.com which already receives traffic.
It will shortly be replaced with an online store. I need to upload this store to my live server in order to get it approved by the Merchant Facility Providers (MFP), and they require it to be accessible from it's final live location on domain.com in order to get approvals. I can't have users access this site until it has met approvals.
To accomplish this I wish to redirect all domain.com traffic to domain.com/holding/ except for MFP visitors.
Ideally this would be restricted by IP address, however MFP say they will need to grant a number of external parties access, and so IP address based access will not be acceptable and I should use passwords.
So my question is, how can I automatically redirect all traffic from domain.com to the holding page domain.com/holding/ unless they have logged in using a password at domain.com/login?
Users visiting the domain.com should not be asked for a password.
Will this be possible using just .htaccess/.htpasswd?
If so, can someone suggest how the logic of how it could work?
It's not possible using just an .htaccess file as all visitors would be presented with an HTTP standard authentication dialog if you enabled it on your domain.com site at the doc_root level.
Without knowing what scripting language you're using? (you've not indicated in the tags, just apache), but you could provide one index page that both acts as a landing page for users/potential-users as well as provide a login (username/password form) for MFP parties (wherever they may come from).
That way, you fulfil both needs without offending or discriminating in any way against any party.
As #nickhar has pointed out, there appears to be no way of doing this using just .htaccess.
My solution was to use a rewrite rule to redirect all requests from domain.com to domain.com/holding unless a specific cookie was set (checked for using RewriteCond %{HTTP_COOKIE}).
I set this cookie in a php script on domain.com/login, which was password protected using .htaccess/.htpasswd.
This is by no means a particularly secure solution, but is adequate for my purposes of keeping the site hidden from general traffic while the approval process is completed.

Different pages related to website ip address

My website is assigned a particular ip address.
Now, is there any way to configure web server like apache so that when I enter the website url in a browser, it shows a different page than when I enter the ip address related to the website?
Yes. What you're looking for is apache Virtual Hosts.
You'll also need to configure your domain to point to your ip.

Using DNS to Redirect Several Domains into One Single Content. Disaster?

When I searching our web site on Google I found three sites with the same content show up. I always thought we were using only one site www.foo.com, but it turn out we have www.foo.net and www.foo.info with the same content as www.foo.com.
I know it is extremely bad to have the same content under different URL. And it seems we have being using three domains for years and I have not seen punitive blunt so far. What is going on? Is Google using new policy like this blog advocate?http://www.seodenver.com/duplicate-content-over-multiple-domains-seo-issues/ Or is it OK using DNS redirect? What should I do? Thanks
If you are managing the websites via Google Webmaster Tools, it is possible to specify the "primary domain".
However, the world of search engines doesn't stop with Google, so your best bet is to send a 301 redirect to your primary domain. For example.
www.foo.net should 301 redirect to www.foo.com
www.foo.net/bar should 301 redirect to www.foo.com/bar
and so on.
This will ensure that www.foo.com gets the entire score, rather than (potentially) a third of the score that you might get for link-backs (internal and external).
Look into canonical links, as documented by Google.
If your site has identical or vastly
similar content that's accessible
through multiple URLs, this format
provides you with more control over
the URL returned in search results. It
also helps to make sure that
properties such as link popularity are
consolidated to your preferred
version.
They explicitly state it will work cross-domain.