httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel <dferra...@gmail.com>
Subject Re: [users@httpd] virtual host double slash effect, need solution
Date Sun, 16 Jul 2017 16:03:23 GMT
And while at it why not use simple Redirect's since your config fits
perfectly to use them:

<VirtualHost *:80>
    ServerName example.com
    Redirect / http://www.example.com/
</VirtualHost>

simpler, gets the job done, and you don't need a cannon to smash a fly.


2017-07-16 17:48 GMT+02:00 Luca Toscano <toscano.luca@gmail.com>:
> Hi David,
>
> 2017-07-15 3:11 GMT+02:00 David Mehler <dave.mehler@gmail.com>:
>>
>> 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.
>>
>> <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>
>>
>
> Have you tried with RewriteRule ^(.*)$ https://www.example.com$1 [R=301,L] ?
> (note also the https, IIUC you need to force TLS).
>
> Hope that helps,
>
> Luca
>



-- 
Daniel Ferradal
IT Specialist

email         dferradal at gmail.com
linkedin     es.linkedin.com/in/danielferradal

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


Mime
View raw message