YOURLS Short URL to Domain - yourls

Morning - I'd like to redirect my short url ie: https://sho.rt to my domain https://short.com
At the moment my sho.rt is pointing at the admin panel. Could you please advise as to how I'd redirect.
Thank you

You will need to build an index.php file that sits in the yourls top level directory. A simple example of how to redirect using html is.
<html>
<head>
<title>Your Site Title</title>
<script>
window.location.replace("https://www.yourwebsite.com");
</script>
</head>
<body>
<h2>If you are not automatically redirected in 5 seconds, Click Here</h2>
</body>
</html>

Related

pythonanywhere: - img src not showing picture

My page: https://bbqbailey.pythonanywhere.com/ is not showing correctly - image is missing.
I see the picture if I do this from a computer that is logged into pythonanywhere.
I do not see it on any other computer!
So I'm expecting that some sort of permissions problem is going on, but the "ls -al" in console shows everything with 644 permission.
The text is displayed correctly, as is the 'alt' info, but the actual image isn't shown.
I put the image at: /home/mysite/learningFlask/SarahJustinEngaged.jpg, and I can see it as stated above from a computer logged into pythonanywhere, but no other computers can see it if not logged in.
I don't see anything from any computer if I use the "
What am I missing????? Help! We're wanting to show this to family and friends now!!!
Here is my code
<!DOCTYPE html>
<html>
<body>
<h1>Sarah and Justin are Engaged!</h1>
<img src="https://www.pythonanywhere.com/user/bbqbailey/files/home/bbqbailey/mysite/learningFlask/SarahJustinEngaged.jpg" alt="Sarah and Justin are Engaged!" width="567" height="500">
</body>
</html>
actually Django support consept of static file so create a folder name static inside your project folder store all image on that
{%load static%} <!DOCTYPE html> <html> <body> <h1>Sarah and Justin are Engaged!</h1> <img src="{% static 'SarahJustinEngaged.jpg' %}" alt="Sarah and Justin are Engaged!" width="567" height="500"> </body> </html>

Laravel, `.png` image in public/images/product folder not displaying correctly

I am a newbie and just want to go from route->view for one image.
The image name is Frozen_Ophelia_800x.png
Here is my route:
Route::get('/products', function(){
return view('/pages/product');
});
Here is my product.blade.php
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<h1> <img src="public/images/product/Frozen_Ophelia_800x.png"></img></h1>
</body>
</html>
However, when I access either http://localhost:8000/products or http://127.0.0.1:8000/products I just get a tiny little icon in the top left:
I used command line to move the image to that folder from my Desktop in Ubuntu 18.04.
Here is what my project structure looks like with said image displayed:
You can access images form public folder.
(1) pass path with APP_URL
<img src="http://127.0.0.1:8000/images/product/Frozen_Ophelia_800x.png">
(2) pass path without APP_URL
<img src="/images/product/Frozen_Ophelia_800x.png">
Most likely it's an issue with the image URL being determined relative to the current page, so it would be trying to fetch:
http://localhost:8080/products/public/images/product/Frozen_Ophelia_800x.png
You can confirm that by looking at the developer console in the browser, then the network traffic.
If so, you can rewrite the img tag as:
<img src="/public/images/product/Frozen_Ophelia_800x.png">
Adding the / to the start makes the browser look for the image starting at the site root, so:
http://localhost:8080/public/images/product/Frozen_Ophelia_800x.png

Empty page in Webmatrix

I wrote (copied) a first program in WebMatrix. I selected EmptySite template and in Page.cshtml I typed 2 lines. Finaly, the code in Page.cshtml looks like this:
#{
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title></title>
</head>
<body>
<h1>Welcome to the WebMatrix!</h1>
<p>I began to become a web developer on #DateTime.Now.ToString()</p>
</body>
</html>
I pressed "Run" but I got an empty web-page. Nothing is written on it. I received no error message.
Well, what's wrong ?
Thanx,
Eb_Cj
You seem to be going to the default document rather than your page. You can solve this in two ways: either right click on the Page.cshtml node in the project explorer within WebMatrix and select Launch in browser or manually change the URL in your browser to localhost:25776/Page.

How can I have a dynamic image show when someone clicks the Facebook Like button and Posts to Facebook?

Currently, when someone 'likes' a link and creates a Facebook post (via the like button), it will only grab the one image that I specify in the meta tag (via the og:image property).
What is the best way to allow people to post a dynamic image with dynamic description? In my case, I have several items (with image & description) listed on a page that the user should be able to 'like' and post on their wall. Any advice would be much appreciated.
Thanks!
Change the meta tag on click: use this example and modify it to your needs.
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<title>Title Of Page</title>
</head>
<body>
<input type="button" value="Click Me" onclick='$("title").html("Changed Dynamically");'/>
</body>
</html>

mod_rewrite external links issue (wordpress)

i have a redirect.php and a link and it doesn't work in WORDPRESS.
i expect when i click the "hello" link on my site, it goes to redirect.php, the user sees the spinner for 5 secs, and the users exits my site to hello.com
it looks like there is something wrong with mod_rewrite i'm unable to solve
i'd really appreciate a very detailed answers. i am very junior
this what i have.
1.- I have an external link in my homepage:
Hello
2.- In redirect.php, i have:
<html>
<head>
...
<meta http-equiv="refresh" content="5;url=<?php echo $_GET['link'];?>" />
...
</head>
<body>
<h1>You are leaving my site!</h1>
<img src="/images/spinner.gif" alt="spinner" />
</body>
</html>
The link <a href="http://redirect.php?... is incorrect. This should most likely be <a href="/redirect.php?... or any subdirectory on your server.
You should also include the protocol in your link parameter or prepend it in your meta tag. Also make sure to HTML encode the link in your meta tag and to properly URL encode the domain name in your link parameter.
So, change the link to:
Hello
if you have the redirect.php file in the root of your website. And change the meta tag to:
<meta http-equiv="refresh" content="5;url=<?php echo htmlentities($_GET['link'], ENT_QUOTES,);?>" />
And you might want to do some validation on the validity of the link parameter and you possibly also want to check the referrer URL ($_SERVER('HTTP_REFERER')) to make sure you only perform redirects for links from your own website (i.e. don't create an open redirect vulnerability).

Resources