CodeIgniter Forums
What's the path for robots.txt ? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: What's the path for robots.txt ? (/thread-29611.html)



What's the path for robots.txt ? - El Forum - 04-15-2010

[eluser]chefnelone[/eluser]
hello,

Where should I put the robots.txt file?
In application/views ?
If that's correct should I do something else?


What's the path for robots.txt ? - El Forum - 04-15-2010

[eluser]danmontgomery[/eluser]
robots.txt should be in the web root, most likely the same location as codeigniter's index.php


What's the path for robots.txt ? - El Forum - 04-15-2010

[eluser]chefnelone[/eluser]
thanks noctrum

so, there's nothing to do in .htaccess?


What's the path for robots.txt ? - El Forum - 04-15-2010

[eluser]chefnelone[/eluser]
and the sitemap.xml goes also in the root?


What's the path for robots.txt ? - El Forum - 04-15-2010

[eluser]danmontgomery[/eluser]
[quote author="chefnelone" date="1271359933"]thanks noctrum

so, there's nothing to do in .htaccess?[/quote]

You should add it to the rewritecond so it never gets routed... Mine looks like this:

Code:
# Allow these directories and files to be displayed directly:
RewriteCond $1 ^(index\.php|robots\.txt|favicon\.ico|assets)

# No rewriting
RewriteRule ^(.*)$ - [PT,L]

[quote author="chefnelone" date="1271360139"]and the sitemap.xml goes also in the root?[/quote]

Yep


What's the path for robots.txt ? - El Forum - 04-15-2010

[eluser]chefnelone[/eluser]
[quote author="noctrum" date="1271360652"][quote author="chefnelone" date="1271359933"]thanks noctrum

so, there's nothing to do in .htaccess?[/quote]

You should add it to the rewritecond so it never gets routed... Mine looks like this:

Code:
# Allow these directories and files to be displayed directly:
RewriteCond $1 ^(index\.php|robots\.txt|favicon\.ico|assets)

# No rewriting
RewriteRule ^(.*)$ - [PT,L]

[quote author="chefnelone" date="1271360139"]and the sitemap.xml goes also in the root?[/quote]

Yep[/quote]

thanks