0
How we are Hosting the Websites on Google Drive quickly but do not have the access to any web server

If we want to host the websites quickly but do not have the access to any web server, but Google Drive is taken as an alternative. we can also use Google Drive to host basic websites or even complex JavaScript based web apps. we can also upload and publish any kind of static content on websites including HTML pages, images, CSS, icons, audio & video files and podcasts.

Using Google Drive Free Web Hosting

Using old Google Drive, we can easily host websites on the Drive. Firstly we have to upload the files of website to a folder inside the Google Drive, then set the sharing permissions of the folder as public, open the Google Docs viewer in the index.html file and then click on “Preview” link to get the URL of the website.

If you have migrated to the new Google Drive, you will be disappointed to learn that Google has dropped the feature of web hosting. You can create the public folders inside the Drive but the option to publish that folder as a website is not their now.


As there is still an easy workaround that it will let you publish the websites on Google Drive in a single step.

We can also Host the Website on Google App Engine

From Desktop to Google Drive in one step

Put all your website files into one zip file or we can use this zip file and click here to upload that zip file to Google Drive. The tool will generate the public URL of your website in the same step if Once the file has uploaded.

If we are using the tool for first time,we have to click the “Authorize” button since the script needs permission to upload that zip file to the Google Drive.

This Google Script is doing all the hard work internally. When you click the upload, the app creates a folder inside the Google Drive, changes the sharing permissions to public and generates the googledrive.com URL using the new folder ID.

Before hosting the websites on Google Drive there are few things you need to know . One, you have an index.html as that file will be served when someone tries to access the homepage of your site. Second is Google Drive websites have a URL structure like googledrive.com/host/ and there is no way to change the default URL.

Google Drive Websites on Custom Web Domain

If the website is hosting on Google Drive but wish to serve it under your own custom domain, that is not possible till now but we can follow a workaround.

For Example. This website is hosted on Google Drive and here is the same website but hosted on a different web domain. The trick is easy but just we have to wrap the Google Drive website URL inside an IFRAME tag as shown below:

<html>
 <head>
  <style>
    body { margin:0; padding:0; }
    iframe { position: absolute; height: 100%; width: 100%; }
  </style>
  <title>Google Drive Website</title>
 </head>  
 <body>
   <iframe src="https://googledrive.com/host/ABCD/" frameborder="0"></iframe>
 </body>
</html>

The height and width of the attributes of IFRAME tag should set to 100% for the Google Drive website to occupy the entire screen. The only drawback is that the URL in the address bar will not change if we open a different page of the website since you are now browsing inside an embedded page.

Google Drives will serves your website over HTTPS and thus can also used for hosting custom Facebook Pages since Facebook requires the custom pages to serve over the secure HTTP.

Google Drive cannot be used for serving dynamic pages those are generated through PHP scripts on a WordPress website.
  

Post a Comment

 
Top