httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Mehler <dave.meh...@gmail.com>
Subject [users@httpd] virtual host double slash effect, need solution
Date Sat, 15 Jul 2017 01:11:36 GMT
Hello,

I'm running Apache 2.4 on a FreeBSD 10.3 system, with several virtual
hosts. My goal is to have all of them completely ssl, except for the
.well-known area needed for letsencrypt.

I'm getting a double slash effect,

for example example.com//

and similar for other virtual hosts. I've googled and seen references
to my rewrite rules, I've changed lines below which are commented,
which did not solve the issue.

Any suggestions appreciated.
Thanks.
Dave.
PS, the ssl information is accurate on the server just not in this message.

<VirtualHost *:80>
    ServerName example.com
    RewriteEngine On
    RewriteRule ^/?(.*) http://www.example.com$1 [R,L]
# This line also produces the double slash effect
#     RewriteRule ^/?(.*) http://www.example.com/$1 [R,L]
</VirtualHost>
<VirtualHost *:80>
    ServerAdmin webmaster@example.com
    DocumentRoot "/usr/vhosts/example.com/htdocs/"
    ServerName www.example.com
    ServerAlias www.example.com mail.example.com

    ErrorDocument 404 /errordocs/error404.htm
    # share well-known for renewal via Let's Encrypt!
    Alias /.well-known/acme-challenge /usr/local/www/.well-known/acme-challenge

    # Anything that isn't going to example.com/.well-known gets
forwarded to the https site
    RewriteEngine on
    RewriteCond %{REQUEST_URI} !^/.well-known
# These next two lines had the double slash effect
    #RewriteRule (.*) https://www.example.com$1 [R=301,L]
    #RewriteRule (.*) https://www.example.com/$1 [R=301,L]
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

    ErrorLog "/usr/vhosts/example.com/logs/error.log"
</VirtualHost>
<VirtualHost *:443>
    ServerAdmin webmaster@example.com
    DocumentRoot "/usr/vhosts/example.com/htdocs/"
    ServerName www.example.com
SSLEngine on
SSLCertificateFile "fullchain.pem"
SSLCertificateKeyFile "privkey.pem"

    <Directory "/usr/vhosts/example.com/htdocs/">
Options FollowSymLinks
AllowOverRide None
Require all granted
    </Directory>
    <IfModule mod_log_config.c>
        CustomLog "|/usr/local/sbin/rotatelogs -l
/usr/vhosts/example.com/logs/access.log-%Y-%m-%d.log 86400" combined
    </IfModule>

# Disc cache setup
    CacheQuickHandler off
    CacheLock on
    CacheLockPath /tmp/mod_cache-lock
    CacheLockMaxAge 5
    CacheIgnoreHeaders Set-Cookie
    <Location />
        CacheEnable disk
        CacheHeader on
        CacheDefaultExpire 600
        CacheMaxExpire 86400
        CacheLastModifiedFactor 0.5
        ExpiresActive on
        ExpiresDefault "access plus 5 minutes"
        Header merge Cache-Control public
        FileETag All
    </Location>
</VirtualHost>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message