I just reread his question and see that he wants anything without a subdomain...so you are correct. I was thinking he wanted to redirect everything besides certain subdomains. Whoops!
On Jan 19, 2011, at 10:56 AM, Michael Jones wrote: > Seems like that would be an unnecessary administrative headache. Why can't he > just have a regex rule that says if the host is xxxxxxxx.tld then redirect to > www.xxxxxxxx.tld? > > Sent from my iPhone > > On Jan 19, 2011, at 10:43 AM, Caleb Call <[email protected]> wrote: > >> The only way DNS could do it is to setup a wildcard DNS and to have all your >> subdomains with different IPs. DNS is not the place to do it. >> >> To do the rewrite, you need to setup a rules that says, if it doesn't match >> X (which includes a list of all you subdomains) then rewrite to >> www.domain.com. Instead of a rule trying to match. You'll still need a >> wildcard DNS entry though. I'll send an example in a second. >> >> >> On Jan 19, 2011, at 10:35 AM, Chad Sollis wrote: >> >>> using everydns, is that possible? >>> >>> I like that route, however, I also like being able to control it on the >>> server so I do not have to update every domain in dns. >>> >>> (although I am curious if everydns can do that) >>> >>> ~Chad >>> >>> >>> On Jan 19, 2011, at 10:31 AM, <[email protected]> wrote: >>> >>>> Why not just use DNS? instead of mod rewrite? Sorry if I missed >>>> previous info. >>>> >>>> Trevyn >>>> >>>> On Wed, 19 Jan 2011 10:24:00 -0700, Chad Sollis <[email protected]> >>>> wrote: >>>>> Thanks Brian, >>>>> >>>>> sorry for not being totally clear. What I want it to do is actually >>>>> anything without a subdomain, to redirect to www.domain.com if it has >>>>> a subdomain, it will be ignored. Good catch on the QSA. >>>>> >>>>> how would you change the rule to match according to that objective? >>>>> >>>>> thanks >>>>> >>>>> ~Chad >>>>> >>>>> >>>>> On Jan 19, 2011, at 1:00 AM, Bryan Petty wrote: >>>>> >>>>>> On Tue, Jan 18, 2011 at 2:19 PM, Chad Sollis <[email protected]> wrote: >>>>>>> Hey there... to the tune of Wade's request yesterday, trying to make >>>>>>> that a wildcard option, can anyone provide some insight, its not >>>>>>> redirecting as desired :) >>>>>>> >>>>>>> RewriteCond %{HTTP_HOST} >>>>>>> ^((?!\.).)*\.(com|net|org|ws|biz|ws|us|info|mobi|me)$ [NC] >>>>>>> RewriteRule ^(.*)$ http://www.%1.%2/$1 [L,R=301] >>>>>> >>>>>> Are you really just trying to match _ANYTHING_ that doesn't have "www" >>>>>> and redirect it to the "www" equivalent? That's what it looks like, >>>>>> and you didn't explain how you want it to work. >>>>>> >>>>>> This seems like a really bad architectural decision if that's the >>>>>> case, but if that's what you're going for, just check if it has the >>>>>> "www" prefix, and if it doesn't, then redirect. Then, since you're >>>>>> working towards such a wide matching constraint, you might as well >>>>>> make sure it handles SSL and also query strings too, like so: >>>>>> >>>>>> RewriteCond %{HTTPS} =off >>>>>> RewriteCond %{HTTP_HOST} !^www\. [NC] >>>>>> RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [L,R=301,QSA] >>>>>> RewriteCond %{HTTPS} =on >>>>>> RewriteCond %{HTTP_HOST} !^www\. [NC] >>>>>> RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [L,R=301,QSA] >>>>>> >>>>>> Regards, >>>>>> Bryan Petty >>>>> >>>>> >>>>> _______________________________________________ >>>>> >>>>> UPHPU mailing list >>>>> [email protected] >>>>> http://uphpu.org/mailman/listinfo/uphpu >>>>> IRC: #uphpu on irc.freenode.net >>>> >>> >>> >>> _______________________________________________ >>> >>> UPHPU mailing list >>> [email protected] >>> http://uphpu.org/mailman/listinfo/uphpu >>> IRC: #uphpu on irc.freenode.net >> >> >> _______________________________________________ >> >> UPHPU mailing list >> [email protected] >> http://uphpu.org/mailman/listinfo/uphpu >> IRC: #uphpu on irc.freenode.net > > _______________________________________________ > > UPHPU mailing list > [email protected] > http://uphpu.org/mailman/listinfo/uphpu > IRC: #uphpu on irc.freenode.net _______________________________________________ UPHPU mailing list [email protected] http://uphpu.org/mailman/listinfo/uphpu IRC: #uphpu on irc.freenode.net
