Forum Moderators: phranque

Message Too Old, No Replies

410 with wildcard

         

Lorel

1:38 pm on May 10, 2010 (gmt 0)

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



I have about 75 pages that I want to remove with htaccess and would like to use a wildcard so I only have to enter one command.

All files have this format with only the 4 numbers changing to 4 other numbers.

widgets-3374-1.html

This is what I've used for single files but I'm not sure how to set up the wildcard:

RewriteRule ^widgets\.html - [G]

Can someone tell me how to set this up?

jdMorgan

6:12 pm on May 10, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



 RewriteRule ^widgets-[0-9]{4}-[0-9]\.html$ - [G] 


1) See the regular-expressions tutorial cited in our forum Charter for more information.

2) If the old pages have replacements with different numbers, consider 301-redirecting some or all of them to their direct replacements, instead of discarding the old URLs' link juice.

Jim

Lorel

6:43 pm on May 10, 2010 (gmt 0)

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



Thanks Jim

This was a small directory and all pages have 0 PR so no or very little link juice. Owner wants to remove the directory.