Forum Moderators: phranque

Message Too Old, No Replies

410 rewrite capturing multiple urls

how to write it

         

Lorel

4:21 pm on Jan 16, 2008 (gmt 0)

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



I have an htaccess file up and working. I now have about 100 pages that are being deleted (all in the root) and want to set them up with a 410 error. The file names all start out with redwidges with a keyword after, then the .html.

So instead of writing out all 100 urls I assume this is the correct way to write it?

RewriteRule ^redwidgets[A-Z]\.html$ - [G]
RewriteRule ^bluewidgets[A-Z]\.html$ - [G]

jdMorgan

4:29 pm on Jan 16, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That would match only red/bluewidgets followed by a single uppercase letter.

If your keyword are all-lowercase, then use "[a-z]+"
If they are mixed-case, then use either "[a-z]+" or "[A-Z]+" and add the [NC] (no case) flag to [G] -- That is, use "[NC,G]"

Jim

Lorel

4:42 pm on Jan 16, 2008 (gmt 0)

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



Thanks JD!