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

SpiderkingdemonAsked:
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.
0
 
frandshansenCommented:
Maybe if I were you I'd set up an 404 redirect instead.

You can use the directive ErrorDocument

ErrorDocument 404 http://yoursite.com/
0
 
ShaneJonesCommented:
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

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

From novice to tech pro — start learning today.