I can't help but rely on our main man Nintendo for this sort of stuff. I did try but failed miserably. I have a domain.co.uk which used to be a free hosting deal so members could claim their myspam.domain.co.uk subdomain and seed the search engines with crap for free. I now want to 301 redirect *.domain.co.uk/* to www.otherdomain.co.uk negating all subdomains and all files and leaving therm all out in the cold. What's your expert solution to this?
Options +Indexes Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^(.*)$ http://www.otherdomain.co.uk/$1 [R=301,L] Are the sub-domains wildcard?!!! If not, placing the code in every single sub-domain is the only way I can think of doing it!!!
Yes they are, I have no idea which ones there are. The nameservers point to a 3d party solution so I'm not hosting any files, don't have anything in my httpd.conf at all. It literaly could be anything . mydomain.co.uk / any file . any extension. The only given is my domain name. Now I'm going to point the domain to my own server so I need to catch everything related to it either via htaccess or httpd.conf virtual domain to redirect. I don;t have access to WMW but a search pulls up something there: http://www.google.co.uk/search?hl=en&q=wildcard+subdomain+redirect+htaccess&btnG=Search&meta= http://www.webmasterworld.com/forum92/6445.htm On this page I found this: RewriteCond %{HTTP_HOST} !^example\.org$ RewriteRule ^(.*)$ http://example.org/$1 [R=301,L] Code (markup): Isn't that more like it?
Haven't implemented it yet to be honest but looking at the syntax, it will be correct and work as expected.
all you need is RewriteRule ^(.*)$ http://example.org/$1 [R=301,L] you don't need the condition before.