Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > UrlEncoded QueryString View modes: 
User avatar
Member
Member
robert-tailor.co - 5/29/2012 7:05:46 PM
   
UrlEncoded QueryString
Hi,

I just updated a client's website to Kentico v6.0.4297. It seems this new version of Kentico is performing URL encoding all QueryString parameters entered either directly into the editor screens, or when querying URLs via Request.Url.AbsoluteUri in the codebehind.

For example, I'm trying to enter a Facebook 'like' widget into an editable region of our website. When I enter the following code (using 'Source' mode to enter the code directly):

<iframe src="//www.facebook.com/plugins/likebox.php?href=https%3A%2F%2Fwww.facebook.com%2FBrickworksBuildingProducts&width=210&height=300&colorscheme=light&show_faces=true&border_color&stream=false&header=false&appId=117801164989359" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:210px; height:300px; margin-top:20px;" allowtransparency="true"></iframe>


Kentico performs UrlEncoding on the entered text when I save it and it changes to:

<iframe allowtransparency="true" frameborder="0" scrolling="no" src="/www.facebook.com/plugins/likebox.php?href=https%3A%2F%2Fwww.facebook.com%2FBrickworksBuildingProducts&amp;width=210&amp;height=300&amp;colorscheme=light&amp;show_faces=true&amp;border_color&amp;stream=false&amp;header=false&amp;appId=117801164989359" style="border:none; overflow:hidden; width:210px; height:300px; margin-top:20px;"></iframe>


Notice how all the ampersands have all been 'escaped'. This causes the rendered code to break.

How can I turn off this setting?

User avatar
Member
Member
robert-tailor.co - 5/29/2012 10:49:41 PM
   
RE:UrlEncoded QueryString
I've been doing further investigation on this and followed the guidelines suggested here:

http://devnet.kentico.com/Forums.aspx?forumid=45&threadid=19269

and here:

http://devnet.kentico.com/Blogs/Petr-Passinger/April-2010/How-we-add-the-Facebook-Like-button-to-our-blog.aspx

but neither worked for me. Kentico 'escapes' the ASP tags suggested in the second link and they do no render at all.

How can I get this to work?

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 6/3/2012 5:59:48 AM
   
RE:UrlEncoded QueryString
Hi,

could you please apply the latest hotfix for 6.0 version? In a default installation was a bug and widgets in editable region were not resolved correctly.

Best regards,
Ivana Tomanickova

User avatar
Member
Member
robert-tailor.co - 6/4/2012 7:12:05 PM
   
RE:UrlEncoded QueryString
OK - I downloaded and ran Hotfix_6_0_33.exe.

It completed without error, although I had to rename ~/App_Code/CMS/UpgradeProcedure.cs.new to ~/App_Code/CMS/UpgradeProcedure.cs.

The website itself appears to run fine, but CMSDesk is dead. If I attempt to go to the CMSDesk URL, I get the following error:

Server Error in '/' Application.


No further information is supplied.

I'm actually quite impressed the Kentico upgrade was able to achieve this. Not only has it killed the CMSDesk completely, but it has also managed to prevent IIS from showing a stack trace so that I can not even begin to locate the source of the problem.

I've reverted back to the initial v6.0 upgrade. Please advise on how to fix the error caused by the hotfix?

Thanks.

User avatar
Kentico Support
Kentico Support
kentico_zdenekc - 6/6/2012 9:48:13 AM
   
RE:UrlEncoded QueryString
Hello,

that's very strange - have you modified the UpgradeProcedure.cs file in any way? As it should be overwritten by default (it has to contain the correct code to finish the upgrade/hotfix properly).

Could you please optionally try the latest 6.0.34 hotfix?
Are you sure there were no errors during the hotfixing?

Thank you in advance for information.

Best regards,
Zdenek.

User avatar
Member
Member
robert-tailor.co - 6/10/2012 9:46:23 PM
   
RE:UrlEncoded QueryString
kentico_zdenekc wrote: Could you please optionally try the latest 6.0.34 hotfix?
Are you sure there were no errors during the hotfixing?

I actually tried the v6.0.35 hotfix this morning, but exactly the same problems occurred.

The only error reported was that UpgradeProcedure.cs had been modified from it's original state, and so the new UpgradeProcedure.cs file had been renamed with a .new extension. I renamed it to .cs (overwriting the original) and ran the website, which gave me the same error as originally reported.

kentico_zdenekc wrote: that's very strange - have you modified the UpgradeProcedure.cs file in any way? As it should be overwritten by default (it has to contain the correct code to finish the upgrade/hotfix properly).

I haven't knowingly changed this file in any way. It should be the same one that was left following the v5.5R2 -> v6.0 upgrade.

On closer inspection, it seems 2 parts of the file have changed between the 2 versions. In UpgradeProcedure.cs v6.0 (line 794), this:

#region "CMS.Document"

try
{
dci = DataClassInfoProvider.GetDataClass("cms.document");
if (dci != null)
{
SearchSettings ss = dci.ClassSearchSettingsInfos;
SearchSettingsInfo ssi = ss.GetSettingsInfo("42f446ee-9818-4596-8124-54a38f64aa05");
if (ssi != null)
{
ssi.Searchable = true;
ss.SetSettingsInfo(ssi);
}

DataClassInfoProvider.SetDataClass(dci);
}
}
catch (Exception ex)
{
evp.LogEvent("CMS.Document - Upgrade", "Upgrade", ex);
}

#endregion

// Set the path to the upgrade package
mUpgradePackagePath = HttpContext.Current.Server.MapPath("~/CMSSiteUtils/Import/upgrade_55R2_60.zip");

mWebsitePath = HttpContext.Current.Server.MapPath("~/");

// Update all views
TableManager.RefreshDocumentViews();

// Set data version
ObjectHelper.SetSettingsKeyValue("CMSDataVersion", "6.0");

// Clear hashtables
CMSObjectHelper.ClearHashtables();

// Clear the cache
CacheHelper.ClearCache(null, true);

// Drop the routes
CMSMvcHandler.DropAllRoutes();

// Init the Mimetype helper (required for the Import)
MimeTypeHelper.LoadMimeTypes();

CMSThread thread = new CMSThread(Upgrade60Import);
thread.Start();


has been replaced with this in v6.0.35:


// Set the path to the upgrade package
mUpgradePackagePath = HttpContext.Current.Server.MapPath("~/CMSSiteUtils/Import/upgrade_55R2_60.zip");

mWebsitePath = HttpContext.Current.Server.MapPath("~/");

// Update all views
TableManager.RefreshDocumentViews();

#region "After upgrade script"

try
{
// Run after upgrade SQL script
RunSQLScript(mWebsitePath + "App_Data\\Install\\SQL\\Upgrade\\55R2_to_60.sql");
}
catch (Exception ex)
{
evp = new EventLogProvider();
evp.LogEvent("Upgrade to 6.0 - After SQL", "Upgrade", ex);
}

#endregion

// Set data version
ObjectHelper.SetSettingsKeyValue("CMSDataVersion", "6.0");

// Clear hashtables
CMSObjectHelper.ClearHashtables();

// Clear the cache
CacheHelper.ClearCache(null, true);

// Drop the routes
CMSMvcHandler.DropAllRoutes();

CMSThread thread = new CMSThread(Upgrade60Import);
thread.Start();


And a new method has been added to UpgradeProcedure.cs v6.0.35:


#region "Private methods"'

/// <summary>
/// Executes SQL script (file is split according to "GO" commands).
/// </summary>
/// <param name="fileName">Name of the file</param>
/// <param name="connString">Connection string</param>
public static string RunSQLScript(string fileName)
{
if (File.Exists(fileName))
{
string query = File.ReadAllText(fileName);

GeneralConnection conn = ConnectionHelper.GetConnection();

// Split query according to "GO" command and execute these parts separately
int startingIndex = 0;
string partOfQuery = "";
do
{
int index = query.IndexOf("GO" + Environment.NewLine, startingIndex, StringComparison.InvariantCultureIgnoreCase);
if (index == -1)
{
index = query.IndexOf(Environment.NewLine + "GO", startingIndex, StringComparison.InvariantCultureIgnoreCase);
if (index == -1)
{
index = query.Length;
}
}
// Run the query
partOfQuery = query.Substring(startingIndex, index - startingIndex).Trim();
if (!String.IsNullOrEmpty(partOfQuery))
{
SqlHelperClass.ExecuteQuery(partOfQuery, null, QueryTypeEnum.SQLQuery, conn);
}
startingIndex = index + 3;
}
while (startingIndex < query.Length);
}
return null;
}
#endregion


I'm worried how this error may affect our plans to upgrade to v7.0 in the near future.

Thanks for any help you can offer.

User avatar
Member
Member
robert-tailor.co - 6/14/2012 5:41:04 PM
   
RE:UrlEncoded QueryString
kentico_zdenekc wrote: Could you please optionally try the latest 6.0.34 hotfix?
Are you sure there were no errors during the hotfixing?

Thank you in advance for information.

Best regards,
Zdenek.

Hi,

Was there any progress into what was causing this issue? I have supplied detailed information in my previous post. Let me know if you need any additional info.

Thanks,

Rob.

User avatar
Kentico Support
Kentico Support
kentico_zdenekc - 6/15/2012 10:06:54 AM
   
RE:UrlEncoded QueryString
Hi,

The UpgradeProcedure is not actually run during/after the hotfix, this happens only after upgrade. Besides that, its purpose is to upgrade the imported package, if it's older than the current version&hotfix(build) number.
If it's changed during hotfixing, it's normal and shouldn't cause any issue.

When you renamed the UpgradeProcedure.cs.new, what have you made with the UpgradeProcedure.cs file? have you overwritten it by renaming the .new one or have you placed it anywhere else?

As the whole App_Code is re-compiled after any change, the error in the CMSDesk that prevents you to use it should contain key information where exactly is the application failing.

Although you only see "Server Error in '/' Application", the frame should contain the whole error message. Could you please try to place cursor into the error message label and press Ctrl+A to select whole text in the frame?
Then you could copy it into the txt file and send it to us (or paste it here).

Thank you for your cooperation.

Best Regards,
Zdenek.

User avatar
Member
Member
robert-tailor.co - 6/20/2012 12:24:05 AM
   
RE:UrlEncoded QueryString
kentico_zdenekc wrote: Although you only see "Server Error in '/' Application", the frame should contain the whole error message. Could you please try to place cursor into the error message label and press Ctrl+A to select whole text in the frame?


Hi,

I checked the stack trace on the error page's source. It's trying (and failing) to locate AjaxControlToolkit Version=4.1.50927.0.

The version supplied with Kentico's Hotfix bundle is v3.5.50927 (found in 'Hotfix60_36/Setup/bin').

Here is the full stack trace:



<html>

<head>

<title>Could not load file or assembly 'AjaxControlToolkit, Version=4.1.50927.0, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)</title>

<style>

body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;}

p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}

b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}

H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }

H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }

pre {font-family:"Lucida Console";font-size: .9em}

.marker {font-weight: bold; color: black;text-decoration: none;}

.version {color: gray;}

.error {margin-bottom: 10px;}

.expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }

</style>

</head>



<body bgcolor="white">



<span><H1>Server Error in '/' Application.<hr width=100% size=1 color=silver></H1>



<h2> <i>Could not load file or assembly 'AjaxControlToolkit, Version=4.1.50927.0, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)</i> </h2></span>



<font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">



<b> Description: </b>An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.



<br><br>



<b> Exception Details: </b>System.IO.FileLoadException: Could not load file or assembly 'AjaxControlToolkit, Version=4.1.50927.0, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)<br><br>



<b>Source Error:</b> <br><br>



<table width=100% bgcolor="#ffffcc">

<tr>

<td>

<code>



An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.</code>



</td>

</tr>

</table>



<br>



<b>Assembly Load Trace:</b> The following information can be helpful to determine why the assembly 'AjaxControlToolkit, Version=4.1.50927.0, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e' could not be loaded.<br><br>



<table width=100% bgcolor="#ffffcc">

<tr>

<td>

<code><pre>



WRN: Assembly binding logging is turned OFF.

To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.

Note: There is some performance penalty associated with assembly bind failure logging.

To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

</pre></code>



</td>

</tr>

</table>



<br>



<b>Stack Trace:</b> <br><br>



<table width=100% bgcolor="#ffffcc">

<tr>

<td>

<code><pre>



[FileLoadException: Could not load file or assembly 'AjaxControlToolkit, Version=4.1.50927.0, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]

CMS.UIControls.AbstractCMSPage.EnsureScriptManager() +0

CMS.PortalControls.CMSUpdatePanel.OnInit(EventArgs e) +110

System.Web.UI.Control.InitRecursive(Control namingContainer) +133

System.Web.UI.Control.InitRecursive(Control namingContainer) +421

System.Web.UI.Control.InitRecursive(Control namingContainer) +421

System.Web.UI.Control.InitRecursive(Control namingContainer) +421

System.Web.UI.Control.InitRecursive(Control namingContainer) +421

System.Web.UI.Control.InitRecursive(Control namingContainer) +421

System.Web.UI.Control.InitRecursive(Control namingContainer) +421

System.Web.UI.Control.InitRecursive(Control namingContainer) +421

System.Web.UI.Control.InitRecursive(Control namingContainer) +421

System.Web.UI.Control.InitRecursive(Control namingContainer) +421

System.Web.UI.Control.InitRecursive(Control namingContainer) +421

System.Web.UI.Control.InitRecursive(Control namingContainer) +421

System.Web.UI.Control.InitRecursive(Control namingContainer) +421

System.Web.UI.Control.InitRecursive(Control namingContainer) +421

System.Web.UI.Control.InitRecursive(Control namingContainer) +421

System.Web.UI.Control.InitRecursive(Control namingContainer) +421

System.Web.UI.Control.InitRecursive(Control namingContainer) +421

System.Web.UI.Control.InitRecursive(Control namingContainer) +421

System.Web.UI.Control.InitRecursive(Control namingContainer) +421

System.Web.UI.Control.InitRecursive(Control namingContainer) +421

System.Web.UI.Control.InitRecursive(Control namingContainer) +421

System.Web.UI.Control.InitRecursive(Control namingContainer) +421

System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1970

</pre></code>



</td>

</tr>

</table>



<br>



<hr width=100% size=1 color=silver>



<b>Version Information:</b> Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272



</font>



</body>

</html>

<!--

[FileLoadException]: Could not load file or assembly 'AjaxControlToolkit, Version=4.1.50927.0, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

at CMS.UIControls.AbstractCMSPage.EnsureScriptManager()

at CMS.PortalControls.CMSUpdatePanel.OnInit(EventArgs e)

at System.Web.UI.Control.InitRecursive(Control namingContainer)

at System.Web.UI.Control.InitRecursive(Control namingContainer)

at System.Web.UI.Control.InitRecursive(Control namingContainer)

at System.Web.UI.Control.InitRecursive(Control namingContainer)

at System.Web.UI.Control.InitRecursive(Control namingContainer)

at System.Web.UI.Control.InitRecursive(Control namingContainer)

at System.Web.UI.Control.InitRecursive(Control namingContainer)

at System.Web.UI.Control.InitRecursive(Control namingContainer)

at System.Web.UI.Control.InitRecursive(Control namingContainer)

at System.Web.UI.Control.InitRecursive(Control namingContainer)

at System.Web.UI.Control.InitRecursive(Control namingContainer)

at System.Web.UI.Control.InitRecursive(Control namingContainer)

at System.Web.UI.Control.InitRecursive(Control namingContainer)

at System.Web.UI.Control.InitRecursive(Control namingContainer)

at System.Web.UI.Control.InitRecursive(Control namingContainer)

at System.Web.UI.Control.InitRecursive(Control namingContainer)

at System.Web.UI.Control.InitRecursive(Control namingContainer)

at System.Web.UI.Control.InitRecursive(Control namingContainer)

at System.Web.UI.Control.InitRecursive(Control namingContainer)

at System.Web.UI.Control.InitRecursive(Control namingContainer)

at System.Web.UI.Control.InitRecursive(Control namingContainer)

at System.Web.UI.Control.InitRecursive(Control namingContainer)

at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

[HttpUnhandledException]: Exception of type 'System.Web.HttpUnhandledException' was thrown.

at System.Web.UI.Page.HandleError(Exception e)

at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

at System.Web.UI.Page.ProcessRequest()

at System.Web.UI.Page.ProcessRequest(HttpContext context)

at ASP.cmsdesk_header_aspx.ProcessRequest(HttpContext context) in c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\12a8db3b\70d286ea\App_Web_1yfq2z2s.6.cs:line 0

at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()

at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

-->

User avatar
Kentico Support
Kentico Support
kentico_zdenekc - 6/27/2012 9:19:12 AM
   
RE:UrlEncoded QueryString
Hi,

Sorry for not getting back to you earlier...

Have you downloaded and used the correct version for your .NET version you use in the IIS?

If you have .NET 4.0 (according to the AjaxControlToolkit version), you should use the hotfix for the same .NET version...

You would need to compare your DLLs with the BINs of the hotfixes if you're not sure.

Thank you in advance for information.

Regards,
Zdenek

User avatar
Member
Member
robert-tailor.co - 6/27/2012 5:57:49 PM
   
RE:UrlEncoded QueryString
Hi,

I'm running my website in an IIS Application Pool that is set to use .NET Framework v4.0.30319, with Integrated pipeline mode.

I downloaded the Hotfix from here:

http://devnet.kentico.com/Bugtracker/Hotfixes.aspx

Only versions of Kentico prior to v6.0 offered an option to download a hotfix for a specific version of .NET.

The Hotfix installer for v6.0.35 does not include any option to specify the .NET version I am running. I assumed it auto-detected the .NET version it was running...?

In any case, it has copied over the DLL's from the "/DLL/net40" directory.

Which is correct, right?

User avatar
Member
Member
robert-tailor.co - 6/27/2012 6:03:00 PM
   
RE:UrlEncoded QueryString
Also - I downloaded the latest AjaxControlToolkit DLL from CodePlex and put that in the ~/bin directory. However, it's version 4.1.60501 and is still not found by CMSDesk.


User avatar
Certified Developer 8
Certified Developer 8
Jiveabillion - 6/6/2012 3:36:37 PM
   
RE:UrlEncoded QueryString
Are you getting a 404 error in your iFrame?

It's not the fact that the ampersands are being escaped that is causing your problem. Look at your src attribute in the second block of code you posted. It only has one "/" forward slash before the domain name. You need to either put two slashes or specify your protocol like "//" or "http://" or "https://" leaving out the protocol would be best because it will default to the protocol of the page displaying it.

I put this code exactly in on a test site and it worked fine

<iframe allowtransparency="true" frameborder="0" scrolling="no" src="//www.facebook.com/plugins/likebox.php?href=https%3A%2F%2Fwww.facebook.com%2FBrickworksBuildingProducts&width=210&height=300&colorscheme=light&show_faces=true&border_color&stream=false&header=false&appId=117801164989359" style="border:none; overflow:hidden; width:210px; height:300px; margin-top:20px;"></iframe>

User avatar
Member
Member
robert-tailor.co - 6/6/2012 4:43:17 PM
   
RE:UrlEncoded QueryString
Hi,

The first block of code I posted is what I pasted into the box. The second block of code was what Kentico changed it to.

The code you pasted (and said worked fine) - did the ampersands (&) in the QueryString get converted into '&amp;'?

User avatar
Certified Developer 8
Certified Developer 8
Jiveabillion - 6/6/2012 8:53:29 PM
   
RE:UrlEncoded QueryString
Yes. Mainly because the ampersands are SUPPOSED to be encoded as amp; for XHTML compliance.

I copied the second block and fixed the "/" to be "//" and it worked fine.

User avatar
Member
Member
robert-tailor.co - 6/7/2012 5:39:39 PM
   
RE:UrlEncoded QueryString
Jiveabillion wrote: I copied the second block and fixed the "/" to be "//" and it worked fine.

I'm happy for you, but it does not work for me.

I copied the second block too and made the same modification. No joy.

The only thing that worked was changing the following from:

src="//www.facebook.com ...


to

src="http://www.facebook.com ...


So - why does it work for you and not for me?

I am using v6.0.4297

User avatar
Certified Developer 8
Certified Developer 8
Jiveabillion - 6/8/2012 12:21:46 PM
   
RE:UrlEncoded QueryString
It might depend on the browser you use. It's not a Kentico thing. I am using Firefox 13. If you don't have it on any https pages, then it should be fine for you to use http:// instead of //.

User avatar
Member
Member
robert-tailor.co - 6/10/2012 9:35:20 PM
   
RE:UrlEncoded QueryString
Jiveabillion wrote: It might depend on the browser you use. It's not a Kentico thing. I am using Firefox 13. If you don't have it on any https pages, then it should be fine for you to use http:// instead of //.

I've tried using the latest versions of Chrome, Firefox and Safari - they all have the same problem.

We may decide to add some https pages in the near future. How can we get around this?

User avatar
Certified Developer 8
Certified Developer 8
Jiveabillion - 6/11/2012 1:40:55 PM
   
RE:UrlEncoded QueryString
If you add HTTPS pages later and this web part you are adding is not on those pages, then you won't have a problem. If it is on a page template, then you can clone your template and make one to use just for https pages where you use the HTTPS protocol.

Side note: If you're going to go through the trouble to get an SSL certificate and dedicated IP address for your site, you may as well make all of the pages on your site HTTPS and then just update your webparts to use HTTPS as the protocol.

User avatar
Certified Developer 8
Certified Developer 8
Jiveabillion - 6/11/2012 1:44:09 PM
   
RE:UrlEncoded QueryString
One other question that we've all forgot to ask is, Are you testing this in a dev environment or a live one? Are you running project right in Visual Studio or a local IIS site. All of these things could affect whether or not a protocol less url will work.

Read this post on stackoverflow for some more info http://stackoverflow.com/questions/4831741/can-i-change-all-my-http-links-to-just

User avatar
Member
Member
robert-tailor.co - 6/12/2012 4:48:31 PM
   
RE:UrlEncoded QueryString
Jiveabillion wrote: One other question that we've all forgot to ask is, Are you testing this in a dev environment or a live one? Are you running project right in Visual Studio or a local IIS site. All of these things could affect whether or not a protocol less url will work.

Read this post on stackoverflow for some more info http://stackoverflow.com/questions/4831741/can-i-change-all-my-http-links-to-just

I've tried it on both my local development web server (a full version of IIS), and on a 'Live' staging web server. The problem persists on both environments.

:-(

User avatar
Member
Member
robert-tailor.co - 6/12/2012 5:10:00 PM
   
RE:UrlEncoded QueryString
Jiveabillion wrote: One other question that we've all forgot to ask is, Are you testing this in a dev environment or a live one? Are you running project right in Visual Studio or a local IIS site. All of these things could affect whether or not a protocol less url will work.

On further investigation, it appears that Kentico is stripping the extra slashes ('/') from the protocol-less double slash when I click to 'Save' the page within CMSDesk.

So, on the rendered page, the following URL:

//www.google.com

becomes

/www.google.com

and the browser treats it like a path within the website, so attempts to go to:

http://www.mywebsite.com/www.google.com

I can enter any number of consecutive slashes (e.g. 5), and Kentico will strip away all but one of them. If I reload the page in the CMSDesk, I can see that Kentico has removed all the extra slashes.

The only thing that seems unaffected is if I precede the extra slashes with 'http:' or 'https:'

User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 6/13/2012 2:55:59 AM
   
RE:UrlEncoded QueryString
Hello,


we have not noticed this issue before. I have tested the double slash and it is not affected by Kentico. Can you double check your server settings? There can be a rewrite rule (http://forums.iis.net/t/1174772.aspx) there. There can be a protection against double slashes in URLs.


Best regards,
Helena Grulichova

User avatar
Member
Member
robert-tailor.co - 6/13/2012 5:09:39 PM
   
RE:UrlEncoded QueryString
I checked our rewrite rules - there are none in there for double slashes.

I should note that this issue only started happening when we upgraded to Kentico 6. The affected code worked (and continues to work) fine under Kentico 4.

I have not changed any server settings, except that Kentico 6 is running on ASP.NET 4.0 instead of ASP.NET 2.0. The server settings are otherwise identical to what we had on Kentico 4.

Could there possibly be something in the Web.Config file that might cause this?

User avatar
Kentico Support
Kentico Support
kentico_zdenekc - 6/19/2012 10:54:13 AM
   
RE:UrlEncoded QueryString
Hi,

It might be. Maybe you could send us your web.config file (without sensitive info) so we could inspect it - just use our support email address and refer to this thread.

Thanks and regards,
Zdenek.

1 2