I am trying to take a value from QUERY_STRING and compare it to a time var, but I can't get it to work. I have tried several different ways:
- Code: Select all
### URL looks like http://www.somesite.com?norewrite2006031410
# This does not work
RewriteCond %{QUERY_STRING} ^.*norewrite([0-9]{10}).*$
RewriteCond %1 =%{TIME_YEAR}%{TIME_MON}%{TIME_DAY}%{TIME_HOUR}
#This does work
RewriteCond %{QUERY_STRING} ^.*norewrite([0-9]{10}).*$
RewriteCond %1 =2006031410
I am really trying to do something like:
- Code: Select all
### URL looks like http://www.somesite.com?norewrite2006031410
#doesn't work
RewriteCond %{QUERY_STRING}x%{TIME_YEAR}%{TIME_MON}%{TIME_DAY}%{TIME_HOUR} ^.*norewrite([0-9]{10})x([0-9]{10}).*$
RewriteCond %1 <%2
#also does not work
RewriteCond %{QUERY_STRING}x%{TIME_YEAR}%{TIME_MON}%{TIME_DAY}%{TIME_HOUR} ^.*norewrite[0-9]{10}x\1.*$
#This works
RewriteCond %{QUERY_STRING}x%{TIME_YEAR}%{TIME_MON}%{TIME_DAY}%{TIME_HOUR} ^.*norewrite([0-9]{10})x([0-9]{10}).*$
RewriteCond %1 <2006031410
In the cases above, it is the second line that does not match.
It seems like variables are not allowed on the condition pattern side of a RewriteCond.
Is this true?
Does anyone have suggestions as to how I can do this sort of comparison?