Return-Path: Delivered-To: apmail-httpd-users-archive@www.apache.org Received: (qmail 59999 invoked from network); 17 Jul 2007 15:21:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Jul 2007 15:21:42 -0000 Received: (qmail 16913 invoked by uid 500); 17 Jul 2007 15:21:30 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 16901 invoked by uid 500); 17 Jul 2007 15:21:30 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 16890 invoked by uid 99); 17 Jul 2007 15:21:30 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Jul 2007 08:21:29 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of jultus@gmail.com designates 64.233.162.227 as permitted sender) Received: from [64.233.162.227] (HELO nz-out-0506.google.com) (64.233.162.227) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Jul 2007 08:21:25 -0700 Received: by nz-out-0506.google.com with SMTP id l1so1159738nzf for ; Tue, 17 Jul 2007 08:21:04 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=NOhyLwU0qcuVIJtygnXeVj9wJe79sCIbPVUXvpqNfxA95TWJGVayL49CBj87qzMlBN9jnaOJRXDjLPc8XmPjv3bhkD72v9fM7AAis/aW9kq+ST+lK1smHeTCP4I60wsIVpF83vcSU0bsP6dZnqOFQoSAn/sdKljQD/GN125Bc4I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=hTqGGZQJIyfMULJjAjnnNvz9iNJZz/QnwcFkwVTkZg0c+mcGXIzntJA4RhmN6cIg/Tw7uJ3iMfSq3PrM4AtwXWNbKpaOEK/I53zU9VCIri/U3WefzUSIirAM04NaGN2rhd9340am68KGmcRqW12OXhxPxMfgczE+B2hyF2eBmss= Received: by 10.140.250.14 with SMTP id x14mr143667rvh.1184685664015; Tue, 17 Jul 2007 08:21:04 -0700 (PDT) Received: by 10.140.203.9 with HTTP; Tue, 17 Jul 2007 08:21:03 -0700 (PDT) Message-ID: Date: Tue, 17 Jul 2007 17:21:03 +0200 From: "Julius Thyssen" To: users@httpd.apache.org In-Reply-To: <469C916C.58E1.0045.0@metrostate.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <469C916C.58E1.0045.0@metrostate.edu> X-Virus-Checked: Checked by ClamAV on apache.org Subject: Re: [users@httpd] Mod Rewrite assistance sought (hoped for :-) On 7/17/07, Robert Granvin wrote: > Standard web site is at "http://foo.site.com/..." while > the secure URL is at "https://secure.site.com/foo/..." So you can't use the same document root for both hosts? If you need different content, except for some folders, simply use the Alias directive in httpd.conf. Alias /images "/var/www/foo/images" or something. > (Basically, make sure that local references such as "/images/blah.gif" > become "/foo/images/blah.gif" and hard URLs embed the site reference into > it... The user will connect to "https://secure.site.com/foo", > but I need to extract the "foo" to use in the other URLs.) I'd use a symbolic link for that. So, on the server, if it's linux/unix: # ln -s /foo/images /images or whatever you need for that. To use Rewrite for that is overkill. If you would like httpS to 'appear' only for secure.site.com, do something like this in httpd.conf: NameVirtualHost *:80 ServerName site.com DocumentRoot /var/www/site.com_doc-root ServerAlias *.site.com # this ^^ catches mistyped hostnames, like "ww.site.com" # and "wwww.site.com", and limits traffic # by having all calls go to one hostname.. RewriteEngine on RewriteCond %{HTTP_HOST} ^secure\.site\.com RewriteRule ^/(.*)$ https://secure.site.com/$1 [R,L] RewriteCond $1 =secure RewriteRule ^/(.*)$ https://secure.site.com/ [R,L] # this all forces the "secure.site.com" requests to go over SSL. RewriteCond %{HTTP_HOST} !^site.com(:80)?$ RewriteRule ^/(.*) http://site.com/$1 [L,R] RewriteOptions inherit and then this - for example - in ssl.conf: DocumentRoot /var/www/secure.site.com_doc-root ServerName secure.site.com:443 ErrorLog logs/ssl_error_log TransferLog logs/ssl_access_log LogLevel warn SSLEngine on SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP SSLCertificateFile /etc/httpd/conf/ssl.crt/server.crt SSLCertificateKeyFile /etc/httpd/conf/ssl.key/server.key SSLCertificateChainFile /etc/httpd/conf/ssl.crt/ca.crt SSLCACertificatePath /etc/httpd/conf/ssl.crt SSLOptions +StdEnvVars SSLOptions +StdEnvVars SetEnvIf User-Agent ".*MSIE.*" \ nokeepalive ssl-unclean-shutdown \ downgrade-1.0 force-response-1.0 CustomLog logs/ssl_request_log \ "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b" -- # Julius B. Thyssen --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See for more info. To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org " from the digest: users-digest-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org