Preventing Google from Indexing Multiple Telerik.Web.UI.WebResource.axd
Environment
| Property | Value |
|---|---|
| Product | Progress® Telerik® UI for ASP.NET AJAX |
| Version | all |
Problem
I want to prevent search engines, particularly Google, from indexing multiple instances of the Telerik.Web.UI.WebResource.axd file with different parameter values. However, when I view the pages on the site using 'View Page Source', I don't see the file in the source. What am I missing? Is there any way to prevent search engines from trying to index these resources?
Description
The ScriptResource.axd and Telerik.Web.UI.WebResource.axd are resource handler URLs used by the ASP.NET framework to deliver embedded JavaScript and CSS resources to the client-side (browser). They are not typically visible in the page source because they are generated dynamically and are part of the backend processing.
Solution
To prevent search engines from indexing multiple instances of the Telerik.Web.UI.WebResource.axd file, you can follow these steps:
-
Use the
RadScriptManagercontrol to combine WebResource requests for scripts into one. You can find more information about theRadScriptManagercontrol in the Telerik documentation: ScriptManager and Combining Scripts.markup<telerik:RadScriptManager ID="RadScriptManager1" runat="server" EnableScriptCombine="true" /> -
Use the
RadStyleSheetManagercontrol to combine theTelerik.Web.UI.WebResource.axdCSS files into a single handler. You can find more information about theRadStyleSheetManagercontrol in the Telerik documentation: StyleSheetManager and Serving External Style Sheets.markup<telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server" EnableStyleSheetCombine="true" /> -
Consider using Telerik CDNs or a local CDN to configure the controls to use JavaScript and CSS files instead of web resource handlers. You can find more information about CDNs in the Telerik documentation: ScriptManager CDN Support and StyleSheetManager CDN Support.
-
To prevent search engines from indexing the
Telerik.Web.UI.WebResource.axdresources, you can use therobots.txtfile. This file, located at the root of your website, instructs search engine bots on which pages or files they should or shouldn't index.Add the following rule to your
robots.txtfile:plaintextUser-agent: * Disallow: /Telerik.Web.UI.WebResource.axdFor better coverage, you can add the following rules:
plaintextUser-agent: bingbot Disallow: /ScriptResource.axd Disallow: /WebResource.axd Disallow: /Telerik.Web.UI.WebResource.axdThis will tell all compliant search bots not to index URLs that contain
/ScriptResource.axd,/WebResource.axd, and/Telerik.Web.UI.WebResource.axd.
You can find more information about preventing error messages for WebResource.axd errors from appearing in the application log in the following StackOverflow discussion: How to prevent error messages for WebResource.axd errors from appearing in the Application log?