Forum Moderators: phranque

Message Too Old, No Replies

How to set up wildcard for all files in a directory?

I want them all gone

         

Lorel

9:35 pm on Oct 16, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I understand this is the code to use if you want the SE to know a file is gone (so it returns a 401 (no longer available).

RewriteRule ^test\.html - [G]

However i have a whole directory (it's contents and the directory itself) that I want "gone".

Is this the correct way to set this up?

RewriteRule ^directory/* - [G]

jdMorgan

11:20 pm on Oct 16, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Omit the "$" end-anchor; Anything that starts with "directory/" will match, and return a 410.

RewriteRule ^directory/ - [G]

For more information, see the regular expressions tutorial cited in our forum charter [webmasterworld.com].

Jim

Lorel

2:32 am on Oct 17, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



But there is no $ in this line of code.

?

jdMorgan

4:02 pm on Oct 17, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



...And therefore, anything that starts with "directory/" will match, and return a 410.

See the regex tutorial cited above, and specifically the 'anchoring' section; It will explain this in-depth.

Jim