Amazon S3 Static Web Hosting with ASPX file extension but pure HTML - html

Is it possible to host web pages with .aspx extension but without dynamic code, including only HTML?
For example, index.aspx as
<!doctype html>
<head>
<meta http-equiv="content-type" content="text/html">
</head>
<body>
This is a fake ASPX page
</body>
</html>

Yes you can
Example
When you upload your file add the following metatag
Content-Type: text/html
In this case, the object is public

Related

How to 301 redirect a static url to another static url?

My website is HTML/CSS/JS website with no server (static website) sitting on MS Azure.
I have recently changed 2 of the html files like this:
www.mydomain.com/oldfile1.html
www.mydomain.com/oldfile2.html
To
www.mydomain.com/newfile1.html
www.mydomain.com/newfile2.html
how can I redirect the old url for the sake of SEO, considering the webiste is static and .htaccess doesn't work and it seems the using meta tag in html file is not considered as 301 permanent redirection?!
A 301 Redirect is a server side directive.
Anything you place in a client side file (<meta> / javascript) cannot be read by the browser until the files arrive in the browser.
At this point it's too late to execute a server side directive.
You're now pointing the browser at the destination you're trying to point it away from.
Probably not the best answer, but you could change the the html of oldfiles to redirect to the newfiles.
So something like this:
<html>
<head>
<!--Tells search engines to not index this page-->
<meta name="robots" content="noindex">
<!--Redirect to new resource-->
<meta http-equiv="Refresh" content="0; url=www.mydomain.com/newfile1.html">
</head>
<body>
<!--In case both JavaScript and the meta tag fail-->
<p>If you aren't automatically redirected please followthis link.</p>
<script>
//JavaScript fallback if browser does not support/allow http-equiv="Refresh"
window.location = 'www.mydomain.com/newfile1.html'
</script>
</body>
</html>

Page redirection not working unless I add .html to the URL

I had a client that gave a URL in a press kit before the website was done. He gave a page when I was making the website a one page site. So I took the URL he made and coded it as a redirect to scroll to that part of the site.
Now that I have it online, it isn't working properly.
fuzzripper.com/bio gives me an internal server error
fuzzripper.com/bio.html works just fine
I would like it to work even if the user doesn't type .html
Here is my redirect code
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="1; url=http://www.fuzzripper.com/#about">
<script type="text/javascript">
window.location.href = "http://www.fuzzripper.com/#about"
</script>
<title>Page Redirection</title>
</head>
<body>
<!-- Note: don't tell people to `click` the link, just tell them that it is a link. -->
If you are not redirected automatically, follow this <a href='http://www.fuzzripper.com/#about'>link</a>.
</body>
</html>
A quick fix for static sites is to
Create a /bio folder
Move bio.html in bio folder
Rename bio.html to index.html
This should make the bio#about link work just fine.

Why would this Core 1 web app render no output?

I've just started following a tutorial, and not even the evergreen "Hello world" works.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Hello</title>
</head>
<body>
<h1>Hello</h1>
</body>
</html>
This is in wwwroot and any other code in the project is VS generated boilerplate. I would expect to see a Hello header on my page when I run the project, but there is nothing visible, even if I view page source the page is completely snow white.
If you want ASP to serve up an index.html file you'll need to enable it by adding UseDefaultFiles() and UseStaticFiles() in your Startup.cs Configure() method.
https://docs.asp.net/en/latest/fundamentals/static-files.html#serving-a-default-document

Why I can't develop single html page with linked css or js files?

What is wrong with Chrome? I want to develop just a single html page. Without any server. Just one page. I know that I need web-server for using that page. But I need to just create a short simple html page with linked js and css files. And I can't do this, because chrome is too smart and I get the same error from chrome:
Not allowed to load local resource
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title>ACAB</title>
<script type='text/javascript' src="./data_statistic.js"></script>
....

Save To Drive Button Doesn't Work

I wrote a simple file server in NodeJS to serve a HTML page with a Save To Drive button. HTML page is served at my_address:1337 and file to be saved is served at my_address:1338. Upon clicking the Save To Drive button, it shows "Starting Download" for a long time then displays Failed Download. XHR Error.
I thought this was due to the fact that the file was being served from a different port so I decided to do the same with an appengine app. Page served at http://sayodrive.appspot.com/index.html and file served at http://sayodrive.appspot.com/drivefile.jsp, I got the same problem.
Then I decided to do a local Java web application: same problem. Then I tried changing the content disposition to attachment (to force a download) but didn't work either.
Frustrated, I started Googling and came across this page that claims the Save To Drive button doesn't actually work.
So I went back to the official Google Drive SDK page and discovered that their example button doesn't work too. Is this a bad dream?
SOURCE: index.html
<html>
<head>
<title>Test: Save To Drive</title>
<!-- -->
<link rel="canonical" href="http://sayodrive.appspot.com">
<script src="https://apis.google.com/js/plusone.js"></script>
</head>
<body>
<p>This must be the worst HTML you have ever seen :)</p>
<div class="g-savetodrive"
data-src="//http://sayodrive.appspot.com/drivefile.jsp"
data-filename="Test Drive"
data-sitename="Sayo Saves">
</div>
</body>
</html>
SOURCE: drivefile.jsp
<%# page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>DriveFile</title>
</head>
<body>
<%
java.io.Writer w = response.getWriter();
response.setContentType("text/plain");
w.write("If you're reading this in Drive, congrats!");
w.flush();
w.close();
%>
</body>
</html>
The original sample was not working because the Cache-Control header was not being exposed by the server. This is now fixed.
Access-Control-Expose-Headers: Cache-Control, Content-Encoding, Content-Range
More in the documentation.