Skip to Content.
Sympa Menu

unclug - Re: [unclug] Redirect 80 ---> 443 with Apache?

unclug AT lists.ibiblio.org

Subject: UNC Linux Users Group

List archive

Chronological Thread  
  • From: "John W. Sopko Jr." <sopko AT cs.unc.edu>
  • To: UNC Linux Users Group <unclug AT lists.ibiblio.org>
  • Subject: Re: [unclug] Redirect 80 ---> 443 with Apache?
  • Date: Fri, 20 Feb 2004 10:52:32 -0500

Success! John's question made me think!

I am using virtual hosts, (if you use virtual hosts you must have
a virtual host for the primary host or it defaults to the first
virtual host it finds). I put the mod_rewrite in the virtual host section and it works! Now I can sleep this weekend. Guess this makes
sense so the mod_rewrite is not global, dahhhh!

Thanks for all the help!


#NameVirtualHost 152.2.131.244
NameVirtualHost 152.2.129.13

# define the main server, must be defined!
#<VirtualHost 152.2.131.244>
<VirtualHost 152.2.129.13>
ServerName lark.cs.unc.edu
DocumentRoot "/afs/cs.unc.edu/common/doc/www"
RewriteEngine on
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [NC,R,L]
</VirtualHost>

Check it go to:

http://lark.cs.unc.edu and you will get re-directed to https...


John Reuning wrote:

What do you have set in the ServerName directive line?

And have you tried configuring a vhost block for lark.cs.unc.edu and
putting the rewrite rule there?


On Fri, 2004-02-20 at 10:35, John W. Sopko Jr. wrote:

Nothing in the error_log/access_log, looks like it is just ignoring the
rewrite match expression.


_______________________________________________
unclug mailing list
unclug AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/unclug

--
John W. Sopko Jr. University of North Carolina
email: sopko AT cs.unc.edu Computer Science Dept., CB 3175
Phone: 919-962-1844 Sitterson Hall; Room 044
Fax: 919-962-1799 Chapel Hill, NC 27599-3175





Archive powered by MHonArc 2.6.24.

Top of Page