0

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?

apaderno
  • 28,547
  • 16
  • 75
  • 90
Ghan Shyam
  • 626
  • 1
  • 6
  • 18
  • Where is it that you are adding this? Are you doing your own module, using something like the l() function? Basically, can you give an example? – mikesir87 Jun 09 '11 at 03:57
  • i want to create url like this.. example http://www.sciton.com/campaign/resurfacing-seminar-–-syracuse-ny?campid=70150000000Tbdk&eloqua=SEM-110604-SyracuseNY-Lowe Whre http://www.sciton.com/campaign/resurfacing-seminar-–-syracuse-ny is clean url of drupal based on node title and rest is automatic alias added. This is example allready on one site.. but i am unable to do this. – Ghan Shyam Jun 09 '11 at 04:46
  • I would look at the answer from Grayside. You have to separate the query from the path of the link. This will also make it so the link is built correctly, regardless of whether you have Clean URLs turned on too. – mikesir87 Jun 09 '11 at 13:32

3 Answers3

3

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',
  ),
));
Grayside
  • 4,144
  • 21
  • 25
1

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

0

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.

GrayB
  • 539
  • 3
  • 9
  • i want to create url like this.. example http://www.sciton.com/campaign/resurfacing-seminar-–-syracuse-ny?campid=70150000000Tbdk&eloqua=SEM-110604-SyracuseNY-Lowe Whre http://www.sciton.com/campaign/resurfacing-seminar-–-syracuse-ny is clean url of drupal based on node title and rest is automatic alias added. This is example allready on one site.. but i am unable to do this. – Ghan Shyam Jun 09 '11 at 04:47
  • sciton.com/campaign/resurfacing-seminar--syracuse-ny is the alias. you can't add a query string to an alias, but you can use Grayside's suggestion above in a theme. – GrayB Jun 09 '11 at 18:40