Link to home
Start Free TrialLog in
Avatar of M256
M256Flag for United States of America

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
Avatar of ITGaWD
ITGaWD
Flag of United Kingdom of Great Britain and Northern Ireland image

No one will answer that for 50 points.
Avatar of M256

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
RewriteRule ^([0-9.]+)\.cfm)$ /html-files/$1 [L]

Open in new window

Avatar of M256

ASKER

I get this error:
RewriteRule: cannot compile regular expression '^([0-9.]+)\\.cfm)$'
ASKER CERTIFIED SOLUTION
Avatar of caterham_www
caterham_www
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial