hi,

how can i get the correct node alias without the space element in the url?

i'm using this function:

if (arg(0) == 'node' && is_numeric(arg(1))) {
$alias = url(drupal_get_path_alias('node/' . arg(1)), array('absolute' => TRUE));
}

but i'm getting the url with the space element...

result:
http://www.mysite.com/space_element/my-node-title

wanted result:
http://www.mysite.com/my-node-title

thanks.

Comments

hefox’s picture

Status: Active » Fixed

PURL is providing the rewrite of the URL, so this is really how to disable purl.

To disable purl, options can be passed that info:

array('purl' => array('disabled' => TRUE))

so for your example

if (arg(0) == 'node' && is_numeric(arg(1))) {
  $alias = url(node/' . arg(1), array('absolute' => TRUE, 'purl' => array('disabled' => TRUE)));
}
brunorios1’s picture

thank you very much!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.