views:

190

answers:

2

I have a couple of sites in development, which are linking to each other.

What I'd like to do before they are launched is have any missing files on the live sites redirect to the dev sites.

http://www.example.com/test/here.html

Would take you to:

http://dev.example.com/test/here.html

http://www.example.com/index.html would still serve the file from the main site (www), since index.html exists.

Edit: I know it's not the best practice way to do things, but it's a request from the client that links they have to new pages on the live site (which have not been transferred across from dev) will work.

A: 

it's not a good idea to be using your dev files for live really. Dev should be kept for dev work. You should release the core parts of the system excluding any unfinished work and links.

Andi
A: 

Instead of redirecting to a dev site (which is really not a good idea IMO), I'd consider using a custom 404 page. To do this, add this line to your .htaccess file:

ErrorDocument 404 /404page.html
Pascal Thivent