Auto redirection

0

I need something to listen to the url, that is, if the url:

link

for access I want to redirect to another url. The problem is that the url is dynamically generated so

http://localhost:15000/api/ReturnPayment/retornoPayPal?id=" + params.orderNo

I would like to know if there is any way to redirect to another url only from the default url, that is http://localhost:15000/api/ReturnPayment/retornoPayPal/ ignoring everything that comes later

I already have some means of redirection, but they are fixed

    .config(function ($stateProvider, $urlRouterProvider, $locationProvider, $httpProvider) {
    $urlRouterProvider.when('/', '');
    $urlRouterProvider.when('/api/ReturnPayment/retorno', '/');
    $urlRouterProvider.when('/api/ReturnPayment/retornoPayPal', '/');
    $urlRouterProvider.otherwise('/');

I can not pass as a parameter only a part of the url for this to work I have to pass the exact url

    
asked by anonymous 19.10.2017 / 20:30

1 answer

1

Verify that there are parameters with GET .

PHP

<?php 
 if(!isset($_GET)) header('Location: suapagina.php');
?>

Javascript

var pageURL = window.location.href.split('&');

if(pageURL.length <= 1) window.location.href = "http://pt.stackoverflow.com";
    
19.10.2017 / 20:36