Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
I am having a problem with pathauto.
When I created a path alias pattern like shop/product.php?productid=[node:nid] , it converts the URL to shop/product.php%3Fproductid%3D17518
when I type shop/product.php?productid=17518 .... it show page not found.
Kindly help me out this issue.
Thanks,
Comments
Comment #1
xiukun.zhou CreditAttribution: xiukun.zhou commenteddrupal of $_GET parameters is $_GET['q']. When the parameter is shop/product.php?productid=[node:nid] ,Drupal considers it the whole as ($_GET['q']=shop/product.php?productid=[node:nid]) and format the $_GET['q'] by rawurlencode.To modify it, remove rawurlencode from drupal_http_build_query() and drupal_encode_path() function.
Anyhow we suggest you not removing the perameter since it belongs to drupal core.
Comment #2
Dave ReidDrupal does not support query strings in URL alias, so natively we cannot support this functionality in Pathauto either. See #118072: Allow query strings in URL aliases for the feature request in Drupal core.
Comment #3
fjgarlin CreditAttribution: fjgarlin commentedProbably a bit late (2 years late...) but please see my last reply on the previous mentioned thread. Hope it helps.
Comment #4
himanshupathak3 CreditAttribution: himanshupathak3 commentedthanks @figarlin. I'll have a look :)