Forum Moderators: phranque
Thanks
The server can do this. So it would depend on whether your control panel supports it properly.
> Might this mess things up?
Yes, it might indeed. I would not recommend doing this with the "www" subdomain. Any other subdomain would be much safer. This is simply because a lot of search engine spiders and webmasters assume (wrongly) that "www" and "non-www" are always the same site. Many if not most hosting companies set up their servers so that "www" and "non-www" are the same site by default.
> Currently I have a .htaccess 301 redirect to [non-www] from www. Can I modify it so that the redirection works only when the www.example.com/directory does not exist?
Yes, see mod_rewrite's RewriteCond directive, used with the %{REQUEST_FILENAME} variable and the -d flag.
Jim
The AWS forum is dominated by one and two reply threads as a result of your expertize.
My host is indeed setup to serve the same document for www and the none. I have a number of other subdomains setup through the control panel without a problem.
Just to make sure that I understand, Since the server is setup to serve the same document, the Control panel assignment of a new target to www would be a bad idea.
Is this correct?
Thanks again for your great knowledge and help.
For example, no matter how many times you tell Yahoo that the canonical domain for your site is "www.example.com" by using a 301-Moved Permanently redirect from "example.com" to "www.example.com", and even if no-one on the Web ever links to "example.com" instead of "www.example.com", Yahoo Slurp will continue to try to fetch pages from "example.com". This is evidence that they are confused between www and non-www domains at some level, and I would avoid confusing them even more.
I never answer control panel questions, because they are all a little bit different, many of them generate 'bad' (sloppy, buggy, non-optimized) code into httpd.conf, and I avoid them as much as possible. Since I don't use them very much, I'm not much good at answering questions about them.
Jim