I have hosted a simple singlepage HTML/CSS website on github. I wanted to redirect incorrect subpages (ie mysite.com/m) to redirect to the homepage (mysite.com) as the default route. Can this be achieved on a static site on github?
You can create a /m/index.html file containing :
<!DOCTYPE html>
<meta charset=utf-8>
<title>Redirecting...</title>
<link rel=canonical href="/index.html">
<meta http-equiv=refresh content="0; url=/index.html">
<h1>Redirecting...</h1>
Click here if you are not redirected.
<script>location='/index.html'</script>
Related
Hi Goodies i have an issue in pyscript
issue : when i paste the below pyscript code in my WordPress post as an html and press preview it just simply popups to dawnload the pyodide file instead of showing the hello world message in the code below. Please someone can clear that to me why this is happening.
thanks regards
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="https://pyscript.net/latest/pyscript.css" />
<script defer src="https://pyscript.net/latest/pyscript.js"></script>
</head>
<body>
<py-script> print('Now you can!') </py-script>|
</body>
</html>
the output screenshots from the browser where i get this happening.
(1) From WordPress
this is once i write the code in real time wordpress post as an html
this is what i got once i click on preview
(2) Samething is happening in vscode live server instead of the showing the message hello world it just popup my dawnloader idm to dawnload a pyodide file.
this is the code in vscode with the live server
this is what i got once i run with the live server in vscode
i need to run a small python code in my WordPress post when someone visit my website and in that post once he requests some calculation so the python code should be responsible to do some calculations and show that to the user.
any suggestions please
From the logo on the popup messages you're getting in both cases, it looks like this is behavior caused by having [https://www.internetdownloadmanager.com/](Internet Download Manager) (IDM) installed.
When the Pyodide runtime loads, it fetches certain additional files from the web, including pyodide_py.tar (the compressed Python API files the Pyodide Python API, as well as any additional packages specified in <py-config>. If IDM is configured to interrupt fetching these necessary files, Pyodide will fail to load and/or execute.
You may be able to whitelist (allow) IDM to automatically download these files, but that's beyond my knowledge of that particular plugin.
For more discussion, here's a similar issue on the PyScript GitHub.
Im using Strapi 3.6.8 and i came cross a problem i cant understand with loading the Admin panel.
the CMS status page is working perfect and the API is responding with no problem, but when i try to open the Admin panel i get blank page (white page) and in the page source ican see that there are two files that get 404 error (not found).
The files are: runtime-main.XXXXXXX.js, main.xxxxxxx.chunk.js.
The probplem is clear - the files path is wrong as you can see in the files source:
<!doctype html>
<html lang="en">
<head>
<!-- The first thing in any HTML file should be the charset -->
<meta charset="utf-8">
<!-- Make the page mobile compatible -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="mobile-web-app-capable" content="yes">
<title>Strapi Admin</title>
</head>
<body>
<!-- The app hooks into this div -->
<div id="app"></div>
<!-- A lot of magic happens in this file. HtmlWebpackPlugin automatically includes all assets (e.g. bundle.js, main.css) with the correct HTML tags, which is why they are missing in this HTML file. Don't add any assets here! (Check out webpackconfig.js if you want to know more) -->
<script type="text/javascript" src="/undefined/cms/undefined/admin/runtime~main.1727abc3.js"></script><script type="text/javascript" src="/undefined/cms/undefined/admin/main.be8fb29b.chunk.js"></script></body>
</html>
unforthantly, i wasn;t able to figure it by myself, i tried the following:
Checked ENV files
Cleared yarn/npm lock files and node-module folder (and reinstalled)
Update packages
Build and run locally using docker (instead of just runing the server locally)
none of the things i tried is working, im sure it's something really small and stupid to fix. it worked perfeclty until somepoint, but i cant findout what was changed.
Thanks.
I am trying to share the tweet using twitter share button and using twitter cards for post image with my link and i am using :
<meta property="og:image" content="https://farm6.staticflickr.com/5510/14338202952_93595258ff_z.jpg">
<meta property="og:title" content="SOME TEXT">
<meta property="og:description"SOME DESCRIPTION">
<meta name="twitter:site" content="THIS IS CONTENT">
<meta name="twitter:card" content="photo" />
<meta name="twitter:title" content="TWITTER CONTENT">
<meta name="twitter:description" content="TWITTER DESCRIPTION">
<meta name="twitter:image" content="https://farm6.staticflickr.com/5510/14338202952_93595258ff_z.jpg">
and for share button using this:
<a class="twitter-share-button"href="https://twitter.com/intent/tweet?text=Hello%20world">Tweet</a>
<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
but this code only sharing text and link on twitter not with image.
can any one tell me whats wrong with my code?
I just solved this issue by changing the tag name:
<meta name="twitter:image:src" content="https://example.com/img/my_image.jpg">
It seems the documentation is showing twitter:image instead of twitter:image:src.
First, try to use complete path from http or https for example: https://webpage.com/my_path_image.jpg
Check directly in the following links:
Twitter: https://cards-dev.twitter.com/validator
Facebook: https://developers.facebook.com/tools/debug/
If you are still pulling your hair out trying to figure out why Twitter card images are not displaying for pages on your site despite having the correct dimensions and meta tags first try hosting the image on an external server i.e. a public Amazon S3 bucket.
For reasons I have yet to discover the Twitter agent / card validator would not return the image from my server (docker containers behind NGINX proxy) even though all other Twitter and OG Graph online testers returned the image correctly.
As soon as I hosted the image elsewhere the cards worked perfectly.
I have made a Webview app to load a online site in to the view.
now i want to save the css and java script files into the app assets dictionary
to save trafik and speed for the website.
But i cant load the picture from the assets dictionary.
can anyone tell me what i am doihng wrong?
mWebView.loadUrl("http://www.XXX.de/android/index.html");
here the html file on an server:
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Hallo</title>
</head>
<body>
<center>hans hallo</center>
<center><img src="file:////Android/data/com.news/files/weltuntergang.png" height="200" width="200"></center>
</body>
</html>
use
file:///android_asset/
to point to your assets directory
instead of
file:////Android/data/com.news/files/
probably you will need to use loadDatawithBaseurl in your webview for this to work smoothly (in my experience and guidelines recommendation)
Morning all,
I have an app deployed at www.mydomain.com/myAppp . I have created a virtual server and made myApp as the default web app.Hence anyone accessing www.myDomain.com gets redirected to www.myDomain.com/myApp. Now how do add a robots.txt file to my domain as google looks for www.domain.com/robots.txt.
The app is front ended by apache httpd.
Please let me know if you need more information.
Thanks,
Goutham
robots.txt should be under the ROOT directory for the application server. For tomcat its placed in
$CATALINA_HOME\webapps\ROOT
Not sure but putting in this folder will probably do "glassfish\domains\domain1\docroot"
or you can use Robots meta tag in your pages.
<!DOCTYPE html>
<html>
<h:head>
<meta name="robots" content="noindex,nofollow" />
</h:head>
<h:body></h:body>