diff --git a/app/views/categories/index.html.erb b/app/views/categories/index.html.erb
index b18334da5c0..012c5ff9990 100644
--- a/app/views/categories/index.html.erb
+++ b/app/views/categories/index.html.erb
@@ -3,9 +3,9 @@
<% @category_list.categories.each_with_index do |c, index| %>
-
+
diff --git a/spec/requests/categories_controller_spec.rb b/spec/requests/categories_controller_spec.rb
index 5c6baa466ac..32a6677d83e 100644
--- a/spec/requests/categories_controller_spec.rb
+++ b/spec/requests/categories_controller_spec.rb
@@ -17,6 +17,15 @@ describe CategoriesController do
get "/categories"
expect(response.body).not_to include('AMAZING AMAZING')
end
+
+ it 'web crawler view has correct urls for subfolder install' do
+ GlobalSetting.stubs(:relative_url_root).returns('/forum')
+ Discourse.stubs(:base_uri).returns("/forum")
+ get '/categories', headers: { 'HTTP_USER_AGENT' => 'Googlebot' }
+ html = Nokogiri::HTML(response.body)
+ expect(html.css('body.crawler')).to be_present
+ expect(html.css("a[href=\"/forum/c/#{category.slug}\"]")).to be_present
+ end
end
context 'extensibility event' do