如何通过add.php(Facebook)添加页面后将用户重定向到自定义URL

How can I redirect a user to just added page after adding it through add.php?

let's say my url looks like: http://www.facebook.com/add.php?api_key=API_KEY&pages=1

After selecting a page from the select box and clicking 'Add MY_APP_NAME' user is redirected to the wall of the page instead of to freshly added MY_APP.

Notice

I know this type of questions lots of here but i have no found any solution that why i put this question here again.... helps are definitely appreciated

Tried

I tried myself like this using Javascript but seriously not success

<script>
if (window == top) {
  top.location.href = 'https://apps.facebook.com/abc/' + document.location.href.replace(/https?:\/\/[^/]*\/?/, '');
}
function addToPage(page_id){
   top.location.href = 'http://facebook.com/add.php?api_key=<?php echo C_APP_ID; ?>&pages&perms=publish_stream&page='+page_id;
}
</script> 

See Image

enter image description here

https://www.facebook.com/dialog/pagetab?  
  app_id=APP_ID&
  display=popup&
  next=https://facebook.com

Using this alternative method you can specify the URL to be redirected to after interacting with the dialog to add an application to your page in the next parameter.

You could try adding that parameter to your request.

Other possible alternatives for the next parameter are -

  • redirect_url
  • redirect_uri

Both are used elsewhere when dealing with redirecting users - perhaps one of them will assist you as well...