Following on from [this thread, I've moved one of my domains and am now hosting it as an add-on domain on another account. This puts it in a sub-directory e.g. maindomain.co.uk/addondomain.co.uk, so it can be accessed via two URLs. (Three, according to [URL="http://www.sitepoint.com/forums/showthread.php?824291-Hosting-multiple-sites-via-cPanel&p=5048420&viewfull=1#post5048420"]ldcdc](http://www.sitepoint.com/forums/showthread.php?824291-Hosting-multiple-sites-via-cPanel), but I can't find a third version that works.)
I'm trying to redirect maindomain.co.uk/addondomain.co.uk to www.addondomain.co.uk, but I've run into a snag.
I have this in my .htaccess for maindomain.co.uk:
Redirect 301 /addondomain.co.uk/ http://www.addondomain.co.uk/
which works for most pages.
Unfortunately, I also have
Redirect 301 /index.html /index.php
Redirect 301 /contact.html /contact.php
which is causing 404 errors on index.html and contact.html in the add-on domain.
I've tried changing the order of the two redirect sections, but it doesn't help. I've also tried adding
Redirect 301 /addondomain.co.uk/index.html http://www.addondomain.co.uk/index.html
Redirect 301 /addondomain.co.uk/contact.html http://www.addondomain.co.uk/contact.html
but that doesn't work, either.
Where am I going wrong? Is there a better way to do this?