why there is no robots.txt in nop3.5?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
8 năm cách đây
why there is no robots.txt in nop3.5?
8 năm cách đây
It's dynamically generated in RobotsTextFile method of CommonController
8 năm cách đây
what to do if I want to make changes in robots.txt? if I want to add/remove anything?
8 năm cách đây
Customize this method
8 năm cách đây
if I want to use my own robots.txt can I comment the route and add new route with link to new robots.txt on root folder?
8 năm cách đây
Sure, you can customize nopCommerce for any requirement.

1. Remove the following line from web.config file:
<add name="RobotsTxt" path="robots.txt" verb="*" type="System.Web.Routing.UrlRoutingModule" resourceType="Unspecified" preCondition="integratedMode" />

2. Remove the follwoing route from \Presentation\Nop.Web\Infrastructure\RouteProvider.cs:
            routes.MapRoute("robots.txt",
                            "robots.txt",
                            new { controller = "Common", action = "RobotsTextFile" },
                            new[] { "Nop.Web.Controllers" });

3. Add robots.txt file to Nop.Web project with any content you need
8 năm cách đây
thanx so much
8 năm cách đây
@a.m. - Thanks so much for this help.

Now I aqm getting as issue if I want to check the robots.txt generation locally.  When i go to localhost:xxxx/robots.txt, I get the following:

System.Web.Routing.UrlRoutingModule does not implement IHttpHandlerFactory or IHttpHandler.

I get the same issue on our dev site, but it works fine live.  Any ideas what might be happening or how to fix it?
8 năm cách đây
mhagesfeld wrote:
@a.m. - Thanks so much for this help.

Now I aqm getting as issue if I want to check the robots.txt generation locally.  When i go to localhost:xxxx/robots.txt, I get the following:

System.Web.Routing.UrlRoutingModule does not implement IHttpHandlerFactory or IHttpHandler.

I get the same issue on our dev site, but it works fine live.  Any ideas what might be happening or how to fix it?

Please ensure that your site has pool configured with "integrated" mode (not a "classic" one)
8 năm cách đây
Turns out if I deleted the robots.txt that was there it worked, not sure what exactly happened there.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.