How to get the last url in a chain of redirects in vueJS - vue.js

I'm trying to follow through on a url that redirects me to another page using VueJS.
Combing through the docs I could not find anything that allows me to retrieve the last url after the redirect.

You can try document.referrer, it returns the URI of the page that linked to the current page.
If you're using VueRouter, you can also check https://router.vuejs.org/guide/advanced/navigation-guards.html#global-before-guards

Related

VUA and AUTH0 is not landing on previous URL after login

I've been folowing the guide here. It works, the only problem is, when I click on login from:
http://localhost:8082/1#/
Then I'm redirected back to something like: http://localhost:8082/?code=Ws1cWuAuEK6QpFPz&state=LTFLVmZjWGhrSWl3aFhrM3I4N0xSQUJqaFB1M0NhTEtxUElVSkxQOXZXUg%3D%3D#/
While I want to have exactly the same URL in browser as before login.
How to get it?
Idealy some link to guide, as I'm very new to VUE and AUTH0.
EDIT:
I need to not to use mode:history in src/router/index.js As I'am using the url as a path variable for my backend.

How to remove hashtag(#) from vue-router URL?

I want remove hashtag(#) from urls, but also i need to save no-reload mode. Can i do that?
I have: page.com/#/home
I want: page.com/home
I tried mode: 'history', but page reloads with it.
UPD: Is it possible to create SPA app without page reloading and with normal URLs?
When activating the history mode, you need to first configure your server according to the documentation. The reason for that is, that the history mode just changes the URL of the current page. When the user actually reloads the page, he'll get a 404 error, because the requested URL is not actually there. Reconfiguring the server to serve always the main index.html of your SPA resolves this issue.
When using a # in the URL (no history mode), the browser tries to navigate to the element with the ID, which was given after the # (within the same document). This was the original behavior of the fragment identifier. Therefore, if you add a link to your HTML with such a fragment identifier, the browser won't reload the page but actually look for the ID inside the document. The vue-router watches this change and routes you to the correct route. This is the reason it works with hashes. If you just add a regular URL to the HTML, the browser's native behavior is to actually navigate to this page (hard-link). This leads to your experienced reload effect.
The way to handle this, is, to never use regular links to route within a Vue Single-Page-Application. Use the tag <router-link> for routing between one page and another (but only within the SPA). This is the way to go, no matter if the browser allows the navigation with # without reloading or not. Here is the documentation for the recommended routing tag: link
You can also route from one route to another programmatically. Use $router.push() for that. Here is the documentation for that: link

URL Redirection in import.io

Hi I am working on URL http://www.goodtoknow.co.uk/recipes/healthy?page=1&cost_range=any&total_time=any&skill_level=any&tags%5B0%5D=Healthy&tags%5B1%5D=Healthy and creating extractor. But the URL gets redirected to the URL http://www.goodtoknow.co.uk/recipes/healthy automatically in import.io I want to create extractor for the first mentioned URL. Is it possible? Is it happening because of the page requires cookies which they does not support?
If you examine the network requests using chrome or any other web-debugger you can see that the website is calling a second URL for the recipie data:
http://www.goodtoknow.co.uk/recipes/search?q=&page=1&cost_range=any&total_time=any&skill_level=any&tags[0]=Healthy&tags[1]=Healthy&_=1458727079183
This url does not redirect without cookies and you can set the page number manually.
Try training using this URL and see if it avoids the redirecting.

socialengine v4 how to change the page members see after login

I have been trying to do this for days now and cant seem to find any help on how to do is. I want the user after login to be redirected to a different page instead of the members landing page.
Try checking the code in User/AuthController after this comment Run post login hook. There are several ways to do a custom redirect here.
specify a return_url parameter in the link to login page. You can also 64-bit encode the redirect url so that it is compact.
Keep a session variable, namely Zend_Session_Namespace('Redirect')->uri
Write a post login hook onUserLoginAfter and pass a redirect parameter in its response.
If all else fails, hard-code the next line of code which redirects to home :P

How to Inform Google For Page URL Modifications in Same Domain?

I am renewing my web page and changing the site structure. It was in Asp and now it will be in Asp.Net
So page URLs will be modified. And some pages will be removed, some will be added. But mostly, the content and page names are same, only URLs will change.
The site has SEO work in it and we want to loose it minimum.Site is registered in Analytics and Webmaster Tools.
Google searches will end up blank pages and I don't want to loose my rank.
So I'm looking for a way to inform Google about new page URLs. Domain is same, only URLs. For example: the home page was /default.asp and now /home.aspx
Is there a way to tell Google that a particular URL address or page name has changed?
If all that is changing are the page URLs, Google Analytics cannot "know" that a page is the same, just with diferent URL.
But, you could apply a customized pageview using the _trackPageView() method, giving it the original url as parameter.
If you choose to do this, you will have to exclude the line that uses the method in the original GA code and apply it elsewhere, or pass the parameter to it directly with the orignial URL. All this is done in each page.
You can also read more about the method here.
For IIS (Asp.Net) you want to look into the following to find out how to do 301 redirects:
Response.RedirectPermanent(...) for redirecting from a page
or
"IIS 7 Routing Module and web.config" to set up bulk redirecting
I'd also suggest you consider supporting Search Engine Friendly (SEF) URLs while your making the move. The Routing Module can help you there as well.
You need to implement some form of 301 (301 is key) redirects. This way when google or any other search hits the old page, the index is refreshed with the new page. Asp.net allows you to do these redirects even at the IIS level, and where I'd suggest that they live. You'll also want to submit an up to date site map on webmaster tools.
Edit: Here's a good link on the redirects, http://www.iis.net/ConfigReference/system.webServer/httpRedirect