Welcome to WebmasterWorld Guest from 184.108.40.206
I am trying to do a permanent redirect from the following:
http://example.com/old-sub-cat/article-10.shtml --- redirect to --->
Can I use reditectmatch to accomplish this? I am try to avoid adding individual lines to .htaccess because I have thousands to do.
Here is what I was thinking:
RedirectMatch /old-sub-cat/article-*.shtml http://example.com/cat/new-sub-cat/article-$.sthml
Am I close?
Appreciate all help.
RedirectPermanent /old-sub-cat/ http://example.com/cat/new-sub-cat/
Well you were quite close in your RedirectMatch
RedirectMatch /old-sub-cat/article-(*).shtml http://example.com/cat/new-sub-cat/article-$.sthml
RedirectMatch 301 ^/old-sub-cat/article-([^.]+)\.shtml$ http://example.com/cat/new-sub-cat/article-$1.shtml
For more information, see the Apache mod_alias documentation [httpd.apache.org] and the documents cited in our forum charter [webmasterworld.com], particularly the regular-expressions tutorial cited there.
[edited by: jdMorgan at 2:54 pm (utc) on June 18, 2007]