Site Disclaimer Redirect Issues
Site Disclaimer Redirect Issues
I want all the search bots to be able to index all my pages but they get redirected because of the disclaimer. Is there a way to disable the Site Disclaimer redirect solely for bots?
- ForumsAdmin
- AbleCommerce Moderator
- Posts: 399
- Joined: Wed Mar 13, 2013 7:19 am
Re: Site Disclaimer Redirect Issues
The site disclaimer redirection takes place in backend code (PageTracker service). If you do not have the source code available it will not be easy to make this customization.
One way to bypass this without having source could be to write your own page tracking service and hook it up instead of the standard page tracking service. Check this to see how default services can be overridden by custom services. http://wiki.ablecommerce.com/index.php/ ... or_AC_Gold
In the custom page tracking service you can simply extend from the standard service and in your Track() method to do something like
One way to bypass this without having source could be to write your own page tracking service and hook it up instead of the standard page tracking service. Check this to see how default services can be overridden by custom services. http://wiki.ablecommerce.com/index.php/ ... or_AC_Gold
In the custom page tracking service you can simply extend from the standard service and in your Track() method to do something like
Code: Select all
public override void Track(HttpApplication application, HttpContext context)
{
// your custom code to detect if this is a bot request
bool isBot = x ; // what you figured out
if(isBot)
{
StoreSettingsManager settings = AbleContext.Current.Store.Settings;
// temporarily clear the site disclaimer message
string dsMessage = settings.SiteDisclaimerMessage;
settings.SiteDisclaimerMessage = string.Empty;
base.Track(application, context);
// set back the disclaimer message
settings.SiteDisclaimerMessage = dsMessage ;
}
else
{
base.Track(application, context);
}
}
Re: Site Disclaimer Redirect Issues
I will look into that just for curiosity stakes but I decided to implement a jQuery UI dialog box that loads on the page with the disclaimer instead of doing the store redirection for site disclaimer. Thank you for the quick reply.