-2

I want to exclude access to certain files using .htaccess files but i need help generating the correct regexp.

I want to exclude access to these two files:

soft1-pp_1.12-123456789010_amd64.deb
soft1-tt_1.12-123456789010_amd64.deb

Version numbers are changing (1.12-123456789010) and I want the FilesMatch to work even after the versions change. What's the correct RegExp for it?

My .htaccess will be as following:

<FilesMatch "^(filename1|filename2)\.deb$">
        Order allow,deny
        Deny from all
        Allow from 127.0.0.1
</FilesMatch>
user178250
  • 103
  • 1

1 Answers1

0

Try this regexp:

^soft1-(pp|tt)_[.0-9-]*_amd64\.deb$
Pascal Schmiel
  • 1,738
  • 12
  • 17