Mike Soultanian wrote:
Justin Pasher wrote:
Ahhh... Now it should actually be possible. If possible, I would (personally) try to push all traffic to www.csulb.edu whenever they try to pull csulb.edu. Whether or not this is possible in your situation, I do not know. Something like this in the VirtualHost config would do it.

RewriteCond %{HTTP_HOST} !^www\.csulb\.edu$ [NC]
RewriteRule ^/(.*)$ http://www.csulb.edu/$1 [R=permanent]

This would make sure that requests for any pages are always going through www.csulb.edu (as opposed to csulb.edu or any other ServerAlias setting).

Would this affect sites like cota.csulb.edu?

We do make sure that www.cota.csulb.edu and cota.csulb.edu are both valid.

If you have more (sub)domains that point to the same virtualhost, then you won't be able to use the above directive as-is, since it's designed to funnel ALL requests through www.csulb.edu. It's mainly designed for sites that have a handful of alias domains, but only one primary domain. The redirect makes sure all traffic see the same domain in the URL (and it also aids in generating traffic statistics when different domains are treated as different sites to the outside world).

If you only have a small handful of domains that should be left alone, you can put some exceptions in the rules, like this:

# leave these domains alone
RewriteCond %{HTTP_HOST} ^www\.cota\.csulb\.edu$ [NC,OR]
RewriteCond %{HTTP_HOST} ^cota\.csulb\.edu$ [NC]
RewriteRule . - [L]

# push everyone else to www.csulb.edu
RewriteCond %{HTTP_HOST} !^www\.csulb\.edu$ [NC]
RewriteRule ^/(.*) http://www.csulb.edu/$1 [R=permanent,L]

FWIW, I tried visiting the test pages you mentioned above, and both of them actually pushed me to https. Have you cleared your cache to make sure the browser isn't trying to do something weird by caching the previous response it received?
that's odd.. .I did refresh my browser and like you said, it started working. I did still use your version as it has some definite advantages.

Thanks for your help!!
Mike

Good to hear it's working now.

--
Justin Pasher

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: [EMAIL PROTECTED]
  "   from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to