Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2013-05-26 18:10:29

skewray
Member
From: Sunny Southern California
Registered: 2013-04-25
Posts: 261
Website Mastodon

Deep linking to /files

I would prefer that the downloads in /files not be directly accessible, so I did as outlined in the Textpattern installation instructions and renamed the .htaccess file that is intended to prevent this. However, the files there are still appearing in google, and clicking on the google links downloads the files. Does that mean that the “RedirectMatch 403 .*” line in .htaccess does not work as intended?

I assume that my only fallback is to move the /files directory elsewhere.

Last edited by skewray (2013-05-27 18:53:42)

Offline

#2 2013-06-03 12:05:33

springworks
Member
Registered: 2005-01-06
Posts: 172
Website

Re: Deep linking to /files

How about using a directive in your robots.txt file to stop search engines from indexing the files directory?

Try this:

User-agent: *
Disallow: /files/

Offline

#3 2013-06-04 19:01:32

ax
Plugin Author
From: Germany
Registered: 2009-08-19
Posts: 165

Re: Deep linking to /files

You may effectively prevent this by using the smd_access_keys plugin that will generate a token required for download. For example, create a form named “files” with this content:

<txp:variable name="key">
   <txp:smd_access_key url='<txp:file_download_link />' trigger="file_download" />
</txp:variable>
<p><a href="<txp:variable name='key' />"><txp:file_download_name title="1" /> [<txp:file_download_size format="auto" decimals="1" />]</a><br /><txp:file_download_description /></p>

then use this form in the download link, or in a list of downloadable items:

<txp:file_download_list category='<txp:category />' form="files" sort="description" wraptag="ul" break="li" limit="99" />

Last edited by ax (2013-06-04 19:13:04)

Offline

#4 2013-06-05 01:39:34

skewray
Member
From: Sunny Southern California
Registered: 2013-04-25
Posts: 261
Website Mastodon

Re: Deep linking to /files

This is perfect. I have some download categories that I would like to block and other not.

Offline

Board footer

Powered by FluxBB