301 Redirects via .htaccess question

I hoping someone can help this Linux newbie understand a problem I need to solve with 301 redirects. I've enabled the AllowOverride Switch in httpd.conf and created the appropriate .htaccess file. I have 2 old pages I wish to redirect to specific new pages. Then, I'd like all the remaining broken links to redirect to the main default page.

What is the best way to accomplish the third redirect shown below. I tried using similar syntax but it didn't seem to work.See code snippet below

Redirect 301 /pages/locations.html      http://www.website.com/storelocator.htm 
Redirect 301 /pages/about.html          http://www.website.com/about.htm
Redirect 301 /pages/ALLOTHERLINKS       http://www.website.com/

Open in new window

Who is Participating?
caterham_wwwConnect With a Mentor Commented:
-> RedirectMatch

RedirectMatch 301 ^/pages/ http://www.website.com/

matches /pages/foo.

An ErrorDocument 404 with a http://... will generate a 302 redirect only.
Maybe if I were you I'd set up an 404 redirect instead.

You can use the directive ErrorDocument

ErrorDocument 404 http://yoursite.com/
Do it this way should work fine

Redirect 301 /pages/locations.html "http://www.website.com/storelocator.htm"
Redirect 301 /pages/about.html "http://www.website.com/about.htm"
Redirect 301 /pages/ALLOTHERLINKS "http://www.website.com/"

Open in new window

SpiderkingdemonAuthor Commented:
Thank you! This was the answer.
SpiderkingdemonAuthor Commented:
Shane -- thanks for you post but I tried that and it did not work. Caterham-www's answer worked perfect.
All Courses

From novice to tech pro — start learning today.