CodeIgniter Forums

Full Version: What's the path for robots.txt ?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]chefnelone[/eluser]
hello,

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

El Forum

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

El Forum

[eluser]chefnelone[/eluser]
thanks noctrum

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

El Forum

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

El Forum

[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

El Forum

[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