2015-07-28 59 views
0

我正在使用Drupal 7.我面临着一个问题。我想获得完整的网址,但我的网址不干净。在这里,我分享我的网址。我使用的是什么如何在Drupal 7中获得完整的网址

request_uri(), 
current_path(), 
drupal_get_destination(), 
url($_GET['q'], array('absolute' => TRUE), 
$_SERVER(); 

输出

localhost/samplesite.com/sample-page.html?iniref=GOAI147600 

可能的功能我得到

localhost/samplesite.com/sample-page.html 

,但没有得到运气。

回答

0

我不使用Drupal,但你可以与$ _SERVER的网址。

$link = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; 
+0

感谢@Nefro的反馈意见。但我也使用这个,但仍然没有得到。即使在$ _SERVER ['Request_Uri']中,它也显示为空白。 –

+0

你可以粘贴你的.htaccess吗? – Nefro

+0

我想用init_hook处理 –

相关问题