This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

cassiotalle
cassiotalle

i need to add ads.txt file to be accessed in the root my site meuite.com.br/ads.txt I've tried to release access through the htaccess file but it doesn't work return 404 error

'RewriteRule ^ads.txt - [L]'

All file

<IfModule mod_rewrite.c> <IfModule mod_negotiation.c> Options -MultiViews </IfModule> RewriteEngine On RewriteRule ^ads.txt - [L]

##
## You may need to uncomment the following line for some hosting environments,
## if you have installed to a subdirectory, enter the name here also.
##
# RewriteBase /

##
## Uncomment following lines to force HTTPS.
##
#RewriteCond %{HTTPS} off
#RewriteRule (.*) https://%{SERVER_NAME}/$1 [R,L]

##
## Black listed folders
##
RewriteRule ^bootstrap/.* index.php [L,NC]
RewriteRule ^config/.* index.php [L,NC]
RewriteRule ^vendor/.* index.php [L,NC]
RewriteRule ^storage/cms/.* index.php [L,NC]
RewriteRule ^storage/logs/.* index.php [L,NC]
RewriteRule ^storage/framework/.* index.php [L,NC]
RewriteRule ^storage/temp/protected/.* index.php [L,NC]
RewriteRule ^storage/app/uploads/protected/.* index.php [L,NC]

##
## White listed folders
##
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_FILENAME} !/.well-known/*
RewriteCond %{REQUEST_FILENAME} !/storage/app/uploads/.*
RewriteCond %{REQUEST_FILENAME} !/storage/app/media/.*
RewriteCond %{REQUEST_FILENAME} !/storage/temp/public/.*
RewriteCond %{REQUEST_FILENAME} !/themes/.*/(assets|resources)/.*
RewriteCond %{REQUEST_FILENAME} !/plugins/.*/(assets|resources)/.*
RewriteCond %{REQUEST_FILENAME} !/modules/.*/(assets|resources)/.*

RewriteRule !^index.php index.php [L,NC]

##
## Block all PHP files, except index
##
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_FILENAME} \.txt$
RewriteCond %{REQUEST_FILENAME} \.php$
RewriteRule !^index.php index.php [L,NC]

##
## Standard routes
##
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

</IfModule>

mjauvin
mjauvin

add the rule to the beginning of the htaccess file

cassiotalle
cassiotalle

I was able to solve the problem by placing the following line after the line in White listed folders

RewriteCond %{REQUEST_FILENAME} !/*.txt

this way I resolve both the ads.txt and robots.txt issue

1-3 of 3

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.