0

I'm using OctoberCMS to create and manage my website, everything is working as it should.

However, I'm having trouble creating the Robots.txt file and the Sitemap.xml file from my site.

The octobercms works with the folder named "themes" I can not just put the files in it. I tried putting the files in the themes folder and gave routes error.

Crazy
  • 346
  • 1
  • 4
  • 17

2 Answers2

1

Or the easier way is to just create a robots.txt file in your web root directory then allow it to be accessed via .htaccess

RewriteRule ^robots.txt - [L]

0

Create robots.htm file in themes/YOUR_THEME/pages folder and put below content into it

url = "/robots.txt"
==

<--- WRITE YOUR CODE HERE --->

and it will start working as you requested. you can do same for sitemap.xml file too but you just need to do small change into it.

url = "/sitemap.xml"
==

<--- WRITE YOUR CODE HERE --->

Comment below if you need more help. Thanks

Zakir hussain
  • 621
  • 3
  • 12
  • That's not practical, it is better to handle these two from Within your routes and return proper response header and format. – Raja Khoury Apr 09 '19 at 07:30