Oh, well, that should also maintain the {REQUEST_URI} of the original request which is probably not what you want, ergo, I’d fall back on mod_rewrite as follows:
RewriteEngine on
RewriteRule ^{addon_domain_subdirectory}/(.*)$ http://www.addondomain.co.uk/$1 [R=301,L]
As for your redirects, they should work perfectly in the maindomain. The absolute /index.html should restrain that Redirect to the DocumentRoot (of maindomain). Ditto contact.html. If they don’t, continue your mod_rewrite code with:
You’re doing it corretly, therefore, there must be something wrong with the server, i.e., mod_rewrite is not enabled. Have you run the test in my signature’s tutorial (or verified via any other means)? Okay, the easiest way to test that .htaccess is the file being read and parsed is to add foobah as a directive and look for Error 500 (then remove foobah, obviously). On the other hand, if you do not get a 500, then your .htaccess is a red herring … contact your host to find out what the file is that will allow you to use mod_rewrite.
Thanks DK. I should have mentioned that I know mod_rewrite is enabled, because the main domain is set to rewrite domain.co.uk to www.domain.co.uk, and that’s always worked. (I also tried commenting out those lines to see if that might be causing a problem, but it still doesn’t work.)
I’ve tried commenting out other rewrite rules, but without success. I finally cut out all of the rewrite rules apart from the ones mentioned above and I still can’t get it to work. I’ll PM you a copy of the actual .htaccess file, in case I’ve made some daft typo or something in the “real thing” that isn’t in my “censored” version above.
I’ve tried it on three different browsers, and cleared the caches on all of them, so I don’t think it’s simply a caching issue.