Hi.

For example I have a page at node/[nid]/ called closed. If a user navigates to the node at certain times I want them to get redirect to node/[nid]/closed.

I've created the if statement etc but cant get the redirect to work.

ive tried along the lines of

drupal_goto('node/$nid/closed');

but the $ gets converted to %24

so the url will be /node/%24nid/closed rather than inserting the variable.

Any help is appreciated.

Thanks

Comments

jaypan’s picture

Either:

drupal_goto("node/$nid/closed");

Or:

drupal_goto('node/' . $nid . '/closed');

Contact me to contract me for D7 -> D10/11 migrations.