Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Search Doesn't work without full URL View modes: 
User avatar
Certified Developer v7
Certified  Developer v7
Gitesh - 3/31/2011 3:58:47 PM
   
Search Doesn't work without full URL
Hi Guys,

On our website Eftposnow.co.nz, the search doesn't work on one of the URL.

We have found that it doesn't work if the URL is :
http://www.eftposnow.co.nz

But it works if the URL is:
http://www.eftposnow.co.nz/home.aspx

We can surely create a re-direct for the domain which goes to home.aspx but is there something that we are doing wrong in the configuration of Search Webpart?

Thanks
Gitesh Shah

User avatar
Kentico Support
Kentico Support
kentico_radekm - 4/4/2011 8:41:29 AM
   
RE:Search Doesn't work without full URL
Hello.

At first, can you confirm this is default Smart search box web part?

For case search does not work, can you debug its code in CMSWebParts\SmartSearch\SearchBox.ascx.cs, Search() method, and see, whether UrlHelper.Redirect(url.Trim()); line is executed?

Please let me know, which lines of code below are executed. Thank you.

if (!string.IsNullOrEmpty(txtWord.Text))
{
string url = SearchResultsPageUrl;

if (url.StartsWith("~"))
{
url = ResolveUrl(url.Trim());
}

url = UrlHelper.UpdateParameterInUrl(url, "searchtext", HttpUtility.UrlEncode(txtWord.Text));
url = UrlHelper.UpdateParameterInUrl(url, "searchmode", SearchHelper.GetSearchModeString(SearchMode));

UrlHelper.Redirect(url.Trim());
}


Best Regards,
Radek Macalik

User avatar
Certified Developer v7
Certified  Developer v7
Gitesh - 4/10/2011 4:38:40 PM
   
RE:Search Doesn't work without full URL
Hi Radek,

We do't have visual studio installed on our live server.

Is there any othert way to test it?
Can I copy files to my development server and run visual studio debugger on it?

Will that work?

Cheers
Gitesh Shah

User avatar
Kentico Support
Kentico Support
kentico_radekm - 4/12/2011 6:42:31 AM
   
RE:Search Doesn't work without full URL
Hello.

Yes, it should work, files will be the same so you can debug it on your local computer as well.

Best Regards,
Radek Macalik

User avatar
Member
Member
alexo - 6/20/2011 6:52:01 AM
   
RE:Search Doesn't work without full URL
hi!

was there any solution for this problem - if yes, could you tell me? because i have the same problem...

thx

User avatar
Member
Member
kentico_michal - 6/26/2011 5:39:01 AM
   
RE:Search Doesn't work without full URL
Hello,

What is the behavior if you try to access the same page/document with its original URL (/Home.aspx)?

I’m asking above, because postback is not working by default on root of the web site (where there is no specific page accessed) in Kentico CMS because of IIS settings. If you are using IIS 7 or higher, could you please make sure that httpErrors and modules section of your web.config file is set up according to following documentation?

Custom URL extensions IIS7

Best regards,
Michal Legen

User avatar
Member
Member
spectro-jarlen - 7/9/2011 9:46:26 AM
   
RE:Search Doesn't work without full URL
Is there another solution? I tried the web.config, but it just brought my site down. What is the configuration or programmatic workaround to fixing ~/ so that search works from there? I'm getting the same problem.

User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 7/16/2011 4:42:52 AM
   
RE:Search Doesn't work without full URL
Hello,

What do you mean by "it brought your site down"? The practices described in the documentation and work if applied exactly and for your scenario.

Could you please confirm that there is following key in your web.config file as per the documentation?

<modules runAllManagedModulesForAllRequests="true">

If this doesn't help, could you please try to follow this suggestion:

You can also add the following key to the AppSettings section of your web.config file, which ensures that URLs remain the same even after postback.

<add key="CMSUseExtensionOnPostback" value="false" />

Please note that you need only to alter the <modules> tag to <modules runAllManagedModulesForAllRequests="true">. What version of IIS are you using?

Best regards,
Boris Pocatko

User avatar
Member
Member
spectro-jarlen - 11/14/2011 9:59:16 AM
   
RE:Search Doesn't work without full URL
Hi Boris,

I apologize for the extremely long delay in my reply. I upgraded to version 6 of Kentico and this appears to have resolved the issue for me.

Thanks for your help!

Jarlen