We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

URL Helper site_url() adding extra query marker

Development and Programming

borareed's avatar
borareed
17 posts
7 years ago
borareed's avatar borareed

I’m developing a custom addon that is a fairly simple custom form – it defines some variables as template tags in a module file and then those tags are used in an associated template. One of the variables it defines is the action for that form. I was using the site_url() helper to try to format it correctly, but it’s not behaving as expected.

From the docs (https://docs.expressionengine.com/latest/development/legacy/helpers/url_helper.html), it looks like the input parameter should be the desired URI, and then that is appended to the site_url variable from the config file. However when I do a call like this:

site_url("path/to/page");

I get back

https://example.com/?path/to/page

when this variable is rendered in the template. Outputting the helper with no arguments returns just the site_url as expected, with no trailing query marker.

Is anyone able to replicate this behavior, or are there any site settings I should check? I am using EE 3.5.16 but have also seen this behavior in my test EE 4.3.3 environment.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.