[thelist] Apache URL Rewrite ?

Ron Dorman rwd at csi1st.net
Wed Dec 19 01:02:14 CST 2007

We have done a complete redesign of an old site and migrated everything 
to a new server with two new domains.

The *olddomain.com* is a park/redirect domain to *newdomain2.com* on the 
new server, so if someone enters http://olddomain.com in the address box 
of their browser, they see http://newdomain2.com rendered. This is 
handled in the httpd.conf file on the new server via the 'Serveralias' 
directive. May be part of the problem, may not.

In *newdomain1.com* we have a page (from old domain) with a list links 
to a second party server that displays pages with audio playing. Some of 
these second party pages have links back to PDF files on the old domain.

So, we need to do a rewrite of old URL's (embedded into the second party 
html pages)
like: *http://olddomain.com/pdf//filename.ext/*
  to: *http://newdomain1.com/files/pdf//filename.ext/*

Our latest code in .htaccess in the webroot of *newdomain2.com* is:
  RewriteCond %{HTTP_HOST} ^www\.olddomain\.com/pdf/*$ [NC]
  RewriteRule ^/pdf/([A-Za-z0-9].[A-Za-z0-9])$ 
http://newdomain1.com/files/pdf/$1 [R=301,L]

After much searching, reading and several variations of Cond and Rule, 
we still get a 'Page not Found' on *newdomain2.com* when clicking a link 
from second party pages.

Will someone slap me out of my fog and help get this working?

Many Thanks,
Ron D.

More information about the thelist mailing list