How do I redirect an assigned role member to a page after login with a text redirects file? - redirect

So I made a login page using a netlify widget, and in the identity section of the server I assigned myself the role of admin. When I log into the widget it states that I am logged in; however, I remain on the same page. I have a _redirects text file in my root folder which I believed to redirect one from the login page to my library page when they are an admin using the 200 command, but it doesn't take me there after I login. What should I do?
HTML
<body>
<div data-netlify-identity-button href="library.html">Login with Netlify Identity</a></div>
</body>
<script type="text/javascript" src="https://identity.netlify.com/v1/netlify-identity-widget.js"></script>
</html>
_redirects
/login /library 200! Role=admin

Related

How to skip the welcome page and start Strapi right from /admin (login) page?

I've successfully deployed a Strapi app to a VPS (Ubuntu, nginx, etc.) and it works fine. What I want to do now is to redirect a user right to the /admin page. I mean now, after entering https://strapi.my-domain.com in a browser's address panel, user gets the standard welcome page like so:
welcome page
But I want a user to see Strapi's /admin page right after he/she entered https://strapi.my-domain.com in a browser's address panel. Could someone please give any advice how to do that?
I was exploring strapi v4 document for similar problem and found this solution.
Redirecting landing page to admin panel
If you do not wish to have the default landing page mounted on / you can create a custom ./public/index.html using the sample code below to automatically redirect to your admin panel.
✋ CAUTION
This sample configuration expects that the admin panel is accessible on /admin. If you used one of the above configurations to change this to /dashboard you will also need to adjust this sample configuration.
Path — ./public/index.html
<html>
<head>
<meta http-equiv="refresh" content="0;URL='/admin'" />
</head>
</html>
Source: Strapi v4 Document

Redirecting from htm

My client has an old website on freeserve.co.uk (dodgy and free, now belongs to Orange but no support). I want to redirect all pages on the old site to newdomain/index.php. The index page on the old site is index.htm, however most other pages are .html.
Whatever I try the 301 redirect doesn't seem to work. Has anyone come across freeserve before?
You want to redirect the user when they load the page, here are some examples.
Here's the main example
<head>
<script type="text/javascript">
<!--
window.location="http://www.newlocation.com";
//-->
</script>
</head>
but there are a few other options depending what behaviour you're after.

redirect from page b.html if page a.html isnt visited first

how to redirect someone from page B.html if before they haven't visited page A.html.
If page A.html is visited then allow to open and B.html.
All pages are html5
Set a cookie when the visitor goes to a.html. When the visitor navigates to b.html check to see if the cookie has been set, if not, initiate a redirect.
All this can be achieved using Javascript/jQuery / HTML.
jQuery cookie library: https://github.com/carhartl/jquery-cookie
Redirecting in JavaScript: How to redirect to another webpage in JavaScript/jQuery?
Code
Include jQuery and the jQuery cookie plugin on both a.html and b.html. Make sure you download a copy of the jquery.cookie.js file from the github repo linked above.
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="jquery.cookie.js"></script>
On page a.html use this snippet of code to set the cookie when your visitor loads the page:
<script>
$.cookie('page_a_visited', 'true', { expires: 7, path: '/' });
</script>
On page b.html add this code snippet to check if the vistor has the cookie set, and if not, redirect them back to page a.html:
<script>
if($.cookie('page_a_visited') !='true') {
window.location.replace("/a.html");
}
</script>

Linkedin apply button plugin not logging in on IE8

I asked this on the linkedin forum a few days ago, but no response there and nothing in a general web search, so trying here.
i I have an apply button test page at http://solomon.ie/li/ (HTML below also).
On IE8/WinXP if I hit apply, while not logged into my Linkedin account, I get the sign in screen/lightbox, hit Sign in button, get the login form popup, enter my details and the screen flashes. But, instead of getting my profile summary and confirm application , I am back to the the sign in screen/lightbox.
If I am already logged in and hit apply it works as normal. Works fine on IE9 and FF and Chrome.
I reset IE8 to default security settings and cleared cache/cookies. No error messages.
Thanks,
Kevin
--
<html>
<head>
<title> New Document </title>
</head>
<body>
<script src="http://platform.linkedin.com/in.js" type="text/javascript">
api_key: dhap7citpirm
</script>
<h1>solomon test job ie</h1>
<script type="IN/Apply" data-companyid="892056" data-jobId="Cj-222234"
data-jobtitle="Test job 4"
data-jobLocation="Dublin Ireland"
data-questions='[{"question": "Can you drive?"},{"question": "Do you have a SAFEPASS?"}]'
data-email="nospam#gmail.com"></script>
</body>
</html>

Facebook Connect Access denied on line 22 all.js in IE7/8

I created a very, very simple login page using the exact code that is given in the introduction page of the facebook connect website. Every time I try to launch to connect through IE I get an error through javascript asking me if I want to debug a permission denied problem on line 22. Everything works fine in firefox, chrome, etc.
Odd thing is, the same exact error shows up in Hulu the other day when I tried to connect my Hulu account with FB Connect -- the javascript died on a permission denied problem on the same line. I have tried multiple machines (XP, 7 and Vista) and multiple IE browsers (IE7 and 8), same error.
Here is a copy of my code.
<html>
<head>
<title>My Facebook Login Page</title>
</head>
<body>
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script>
FB.init({
appId:'XXXXXXXXXXX', cookie:true,
status:true, xfbml:true
});
</script>
<fb:login-button perms="email,user_checkins">
Login with Facebook
</fb:login-button>
</body>
</html>
This page can be viewed here: http://www.thecmmns.com/facebooktest2.html
Obviously the XXXXX thing is an actual ID on the live site.
Any ideas? I am very surprised I am the only one seeing this since it even happens on Hulu... Anyone else access Hulu or the above site and get access denied with IE7 or IE 8? Any ideas how to fix?
Just add this code before FB.init:
FB.UIServer.setLoadedNode = function (a, b){FB.UIServer._loadedNodes[a.id] = b; }
Read more at my blog.
Change
"https://connect.facebook.net/assets.php/en_US/sdk.js"
to
"https://connect.facebook.com/assets.php/en_US/sdk.js"
That will be ok.
It's weird that Facebook doesn't update their document.