Skip to main content
Commonmark migration
Source Link

You could use the the Rules module to get this to work, together with the Rules URL Argument module. It will make the value of the URL argument available as new variable to Rules. Here is a quote about the Rules URL Argument module (from its project page):

... provides two rules conditions based on URL arguments:

 
  • check if a URL argument is present.
  • compare the value of an URL argument.
 

It also provides an action that makes the value of an URL argument available as new variable to Rules.

The newly provided Rules actions and conditions can be found under the "URL Argument" conditions and actions groups in the rule configuration interface.

For an example of how to use it, refer to Comment # 3 in issue # 1686360 which is about "Pass an amount to the url, ie; site/content/node-title?amount=10 or /node-title?=amount:10". Here is the relevant part of it:

  • add a "Check if URL argument exist" condition to your rule and set the "ARGUMENT" value to "amount".
  • add "Provide URL argument value" action to the rule and set "URL ARGUMENT NAME" value to "amount" and in the "Provided variables" section "ARGUMENT FROM URL - Variable name" to e.g. "amount_from_url".
 

You will now be able to use the amount value as a variable "amount-from-url" for other actions in this rule.

So with that, and specific to your question here, you could make the Rules module perform a redirect of an URL like /view.php?docid=6252 to '/pub/6252'. Combined with your "I have a view working where I can visit /pub/6252 and get the right content." you should be OK to go.

You could use the the Rules module to get this to work, together with the Rules URL Argument module. It will make the value of the URL argument available as new variable to Rules. Here is a quote about the Rules URL Argument module (from its project page):

... provides two rules conditions based on URL arguments:

 
  • check if a URL argument is present.
  • compare the value of an URL argument.
 

It also provides an action that makes the value of an URL argument available as new variable to Rules.

The newly provided Rules actions and conditions can be found under the "URL Argument" conditions and actions groups in the rule configuration interface.

For an example of how to use it, refer to Comment # 3 in issue # 1686360 which is about "Pass an amount to the url, ie; site/content/node-title?amount=10 or /node-title?=amount:10". Here is the relevant part of it:

  • add a "Check if URL argument exist" condition to your rule and set the "ARGUMENT" value to "amount".
  • add "Provide URL argument value" action to the rule and set "URL ARGUMENT NAME" value to "amount" and in the "Provided variables" section "ARGUMENT FROM URL - Variable name" to e.g. "amount_from_url".
 

You will now be able to use the amount value as a variable "amount-from-url" for other actions in this rule.

So with that, and specific to your question here, you could make the Rules module perform a redirect of an URL like /view.php?docid=6252 to '/pub/6252'. Combined with your "I have a view working where I can visit /pub/6252 and get the right content." you should be OK to go.

You could use the the Rules module to get this to work, together with the Rules URL Argument module. It will make the value of the URL argument available as new variable to Rules. Here is a quote about the Rules URL Argument module (from its project page):

... provides two rules conditions based on URL arguments:

  • check if a URL argument is present.
  • compare the value of an URL argument.

It also provides an action that makes the value of an URL argument available as new variable to Rules.

The newly provided Rules actions and conditions can be found under the "URL Argument" conditions and actions groups in the rule configuration interface.

For an example of how to use it, refer to Comment # 3 in issue # 1686360 which is about "Pass an amount to the url, ie; site/content/node-title?amount=10 or /node-title?=amount:10". Here is the relevant part of it:

  • add a "Check if URL argument exist" condition to your rule and set the "ARGUMENT" value to "amount".
  • add "Provide URL argument value" action to the rule and set "URL ARGUMENT NAME" value to "amount" and in the "Provided variables" section "ARGUMENT FROM URL - Variable name" to e.g. "amount_from_url".

You will now be able to use the amount value as a variable "amount-from-url" for other actions in this rule.

So with that, and specific to your question here, you could make the Rules module perform a redirect of an URL like /view.php?docid=6252 to '/pub/6252'. Combined with your "I have a view working where I can visit /pub/6252 and get the right content." you should be OK to go.

Source Link
Pierre.Vriens
  • 36k
  • 40
  • 50
  • 182

You could use the the Rules module to get this to work, together with the Rules URL Argument module. It will make the value of the URL argument available as new variable to Rules. Here is a quote about the Rules URL Argument module (from its project page):

... provides two rules conditions based on URL arguments:

  • check if a URL argument is present.
  • compare the value of an URL argument.

It also provides an action that makes the value of an URL argument available as new variable to Rules.

The newly provided Rules actions and conditions can be found under the "URL Argument" conditions and actions groups in the rule configuration interface.

For an example of how to use it, refer to Comment # 3 in issue # 1686360 which is about "Pass an amount to the url, ie; site/content/node-title?amount=10 or /node-title?=amount:10". Here is the relevant part of it:

  • add a "Check if URL argument exist" condition to your rule and set the "ARGUMENT" value to "amount".
  • add "Provide URL argument value" action to the rule and set "URL ARGUMENT NAME" value to "amount" and in the "Provided variables" section "ARGUMENT FROM URL - Variable name" to e.g. "amount_from_url".

You will now be able to use the amount value as a variable "amount-from-url" for other actions in this rule.

So with that, and specific to your question here, you could make the Rules module perform a redirect of an URL like /view.php?docid=6252 to '/pub/6252'. Combined with your "I have a view working where I can visit /pub/6252 and get the right content." you should be OK to go.