url - Redirect to a new page from within a Drupal site -
I am working with a Drupal site, and we want to set up a special URL that redirects to an external site Does. In other words, if we have a Drupal site, then we have to redirect to an external site.
I have very little experience with Drupal and I do not know how to set it up. Any help is appreciated!
If you want everyone to redirect users to the same site, when they link to a link Follow that which moves them, you can execute using the code like:
  function mymodule_menu () {$ items = array (); $ Items ['external'] = array ('title' = & gt; 'redirection', 'page callback' = & gt; 'mymodule_redirect', 'use callback' = & gt; TRUE, 'type' = & Gt; MENU_CALLBACK,); Return $ items; } Function mymodule_redirect () {drupal_goto ($ url, array ('external' = & gt; TRUE)); }    If the URL to which the user is redirected depends on the value provided in the URL, then you can use the same code as the following code:  
  function mymodule_menu () {$ items = array (); $ Objects ['external'% '] = array (' title '= & gt; redirection,' page callback '= & gt;' mymodule_redirect ',' page logic '= & gt; array (1),' access callback ' = & Gt; TRUE, 'type' => MENU_CALLBACK,); Return $ items; } Calculate the $ url base at the value of mymodule_redirect ($ id) {// $ id} Drupal_goto ($ url, array ('external' => true)); }    
 
  
Comments
Post a Comment