Forum Moderators: phranque
I am using this redirect: redirect 301 /db/ipb.htm [mysite.com...]
It works just fine, but . . .
I'd like it to include the whole alphabet as such:
redirect 301 /db/ip(whole alphabet or alphabet range).htm [mysite.com...]
I have tried: /db/ip[a-z].htm and /db/ip[abcdefghijklmnopqrstuvwxyz].htm, neither of which work.
Also, the "db" could also be "DB"
Perhaps I am using the incorrect method and/or not getting the puncuation correct.
All help is appreciated.
RewriteRule ^db/ip[a-z].htm$ [MySite.com...] [R,NC,L]
RewriteRule ^db/$ [MySite.com...] [R,NC,L]
RewriteRule ^db/ip[a-z[b]]\.h[/b]tm$ http://www.example.com/ [NC,R=301,L]
#
RewriteRule ^db/$ http://www.example.com/ [NC,R=301,L]
However, a good bit of advice is that if you use mod_rewrite for any redirects and/or rewrites, then use it for all redirects and rewrites, because otherwise the execution order of the two kinds of directives is controlled by your server configuration, and not by the order that those directives appear in your code; Execution is 'per-module', and not line-by-line.
If you have not researched (and bookmarked) the Apache module documentation (mod_alias and mod_rewrite in this case), let me suggest that doing so will save you an awful lot of time and frustration...
Jim