MonoX support board

Start the conversation, ask questions and share tips and solutions with fellow developers.

Non-registered users can only browse through our support boards. Please register now if you want to post your questions. It takes a second and it is completely free. Alternatively, you can log in without registration using your credentials at major sites such as Google, Microsoft Live, OpenId, Facebook, LinkedIn or Yahoo.

Blog posts in search results do not work  (Mono Support )

Viewed 5775 time(s), 6 post(s) 2/24/2014 2:54:14 PMby super
super

super

2/24/2014 3:03:58 PM
I have blog container on the homepage.

Initially I posted my issue here on the forums a few months back  that when a user click on blog post on the homepage, the user stays on the homepage and I was told here  that this is by design because of url rewriting rule.

I was advised to change  this:
<rewrite url="^(.*)/(.*)/post/(.*)/(.*)/(.*)/(\?(.+))?$" to="$1/$2.aspx?BlogSlug=$3&BlogPostId=$4&$7" name="BlogPost" defaultPage="/Blog.aspx" urlPattern="/{PageName}/post/{Blog.Slug}/{IdentityId}/{Slug}/" />

To this:
<rewrite url="^(.*)/(.*)/post/(.*)/(.*)/(.*)/(\?(.+))?$" to="$1/$2.aspx?BlogSlug=$3&BlogPostId=$4&$7" name="BlogPost" defaultPage="/Blog.aspx" urlPattern="/Blog/post/{Blog.Slug}/{IdentityId}/{Slug}/" />

But with this url  rewrite rule, when any user use search option and click on any blog post from the search result, it never redirect the user to that post and gives page not found error.

Page not found
 
We couldn't find the page you requested.
 
 
We couldn't find the page you requested.
 
To continue working with the application please click here

Please advise ? any way I can keep the new url rewrite rule so that I can redirect users to blog page and fix the search result problem ?
This content has not been rated yet. 
6018 Reputation 709 Total posts
super

super

2/24/2014 3:06:15 PM
Here is the log

2014-02-24 10:07:28,767 [26] ERROR MonoX [BaseHttpApplication] - Application Error
System.Web.HttpException (0x80004005): The file '/search/gridview/%7e/Blog.aspx' does not exist.
   at System.Web.UI.Util.CheckVirtualFileExists(VirtualPath virtualPath)
   at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
   at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
   at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound)
   at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp)
   at System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath)
   at System.Web.UI.PageHandlerFactory.GetHandler(HttpContext context, String requestType, String virtualPath, String path)
   at System.Web.HttpApplication.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
This content has not been rated yet. 
6018 Reputation 709 Total posts
idrazic

idrazic

2/24/2014 4:54:30 PM
Hi super,

Try setting BlogDisplayUrl to empty, as you can see from the error log it doesn't resolve the url correctly with your combination.
<add key="BlogDisplayUrl" value="" />
Regards,
Igor
This content has not been rated yet. 
1384 Reputation 152 Total posts
super

super

2/24/2014 5:20:41 PM
Hello Igor,

That fixed  the issue - Thank  you

1) Could you please explain what was causing the issue ?

2) What exactly does this solution does by using empty value for blogdisplay ?
This content has not been rated yet. 
6018 Reputation 709 Total posts
idrazic

idrazic

2/25/2014 4:52:19 PM
1)  Tilde  "&#126;/" at the start of the url wasn't resolved when there is no {PageName} in the urlPattern, if you look at the link "href" it shows url with  &#126;/ so request goes to "{root}/current/directory/&#126;/wrong" instead of "{root}/right"

 2) There's a third option when "BlogDisplayUrl" is empty which resolves "&#126;/" to root.  "BlogDisplayUrl" is passed to rewriter method as the "caller" url. 
This content has not been rated yet. 
1384 Reputation 152 Total posts
super

super

2/25/2014 6:45:15 PM
Thank Igor.

I have posted a similar issue with Groups: http://www.mono-software.com/Mono/Pages/Discussion/dtopic/SpDhclwnf0KYy6LdAVXKrA/Group-page-do-not-open-from-the-search-results/

Please help ?
This content has not been rated yet. 
6018 Reputation 709 Total posts