M256
asked on
Mod Rewrite help
First off, this is in my .htaccess file:
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^TRACE
RewriteRule .* - [F]
What does it do?
Second part: I want to conditionally rewrite a set of URLs to a subfolder:
/1456.cfm moves to /html-files/1456.cfm
/901.cfm moves to /html-files/901.cfm
etc.
It needs to work for these matches:
xxx.cfm
xxx.x.cfm
xxx.xx.cfm
xxxx.cfm
xxxx.x.cfm
xxxx.xx.cfm
xxxxx.cfm
xxxxx.x.cfm
xxxxx.xx.cfm
replace x with any number 0-9
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^TRACE
RewriteRule .* - [F]
What does it do?
Second part: I want to conditionally rewrite a set of URLs to a subfolder:
/1456.cfm moves to /html-files/1456.cfm
/901.cfm moves to /html-files/901.cfm
etc.
It needs to work for these matches:
xxx.cfm
xxx.x.cfm
xxx.xx.cfm
xxxx.cfm
xxxx.x.cfm
xxxx.xx.cfm
xxxxx.cfm
xxxxx.x.cfm
xxxxx.xx.cfm
replace x with any number 0-9
No one will answer that for 50 points.
ASKER
My apologies. Is 300 acceptable?
Yep
> What does it do?
it denies requests which are using the request method TRACE instead of GET, POST etc.
> /1456.cfm moves to /html-files/1456.cfm
> /901.cfm moves to /html-files/901.cfm
it denies requests which are using the request method TRACE instead of GET, POST etc.
> /1456.cfm moves to /html-files/1456.cfm
> /901.cfm moves to /html-files/901.cfm
RewriteRule ^([0-9.]+)\.cfm)$ /html-files/$1 [L]
ASKER
I get this error:
RewriteRule: cannot compile regular expression '^([0-9.]+)\\.cfm)$'
RewriteRule: cannot compile regular expression '^([0-9.]+)\\.cfm)$'
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.