0

I'm trying to forbid users access to a certain folder that has the current date in the folder name.

This does not work:

RewriteCond %{REQUEST_URI} ^/folder%{TIME_YEAR}%{TIME_MON}%{TIME_DAY}
RewriteRule .* - [F]

This does (considering today is 2015-11-16)

RewriteCond %{REQUEST_URI} ^/folder20151116
RewriteRule .* - [F]
Larcho
  • 101
  • 1

1 Answers1

1

According to http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewritelog The rewrite condition would be of the form RewriteCond TestString CondPattern

TestString is a string which can contain ... expanded constructs in addition to plain text

and

CondPattern is the condition pattern, a regular expression which is applied to the current instance of the TestString. TestString is first evaluated, before being matched against CondPattern.

According to that you are only allowed to use the date constructs in the TestString not the CondPattern.

David King
  • 476
  • 2
  • 6