2013-02-10 19:02:57 -05:00
|
|
|
class RobotsTxtController < ApplicationController
|
|
|
|
layout false
|
|
|
|
skip_before_filter :check_xhr
|
2013-02-11 01:14:36 -05:00
|
|
|
skip_before_filter :check_restricted_access
|
2013-02-10 19:02:57 -05:00
|
|
|
|
|
|
|
def index
|
2013-03-01 12:45:25 -05:00
|
|
|
path = if SiteSetting.allow_index_in_robots_txt && SiteSetting.access_password.blank?
|
2013-02-10 19:02:57 -05:00
|
|
|
:index
|
|
|
|
else
|
|
|
|
:no_index
|
|
|
|
end
|
2013-02-25 11:42:20 -05:00
|
|
|
|
2013-02-10 19:02:57 -05:00
|
|
|
render path, content_type: 'text/plain'
|
|
|
|
end
|
|
|
|
end
|