I want to use the question mark in the auto-generated path aliases

五迷三道 提交于 2019-12-11 22:12:53

问题


I want to use the question mark the automatically generated path aliases, but when I write the question mark, it is changed to %3f.

How can I fix this?


回答1:


The URL you are trying to use appears to be used as a proper delimiter of path vs. query string. You should not attempt to add the question mark yourself, but instead implement the section after the question mark as query string. For example:

l(t('My Link'), 'campaign/resurfacing-seminar', array(
  'query' => array(
    'campid' => '70150000000Tbdk',
    'eloqua' => 'SEM-110604-SyracuseNY-Lowe',
  ),
));



回答2:


Drupal's url() function is better if you are incorporating it in a form action or a drupal_goto() function.

Here is the link to the function explanation: http://api.drupal.org/api/drupal/includes--common.inc/function/url/6




回答3:


You really can't if you want things to work correctly. The "?" is a special character that signifies the end of the URI and the beginning of the query string. Doing what you suggest would break a lot of your other drupal pages.



来源:https://stackoverflow.com/questions/6278135/i-want-to-use-the-question-mark-in-the-auto-generated-path-aliases

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!