[dns-operations] bug in Apache handling of real FQDNs

Craig Leres leres at ee.lbl.gov
Mon Jun 8 15:07:39 UTC 2015


On 06/08/15 01:32, TOURNAT Guillaume wrote:
> Here are apache rewrite rules that redirect to the url without the trailing
> dot:
> 
>     RewriteEngine On
> 
>     # Don't switch protocols
>     RewriteCond %{HTTPS} =on
>     RewriteRule ^(.+)$ - [env=myproto:https]
>     RewriteCond %{HTTPS} !=on
>     RewriteRule ^(.+)$ - [env=myproto:http]
> 
>     # Remove trailing dot
>     RewriteCond %{HTTP_HOST} ^(.*)\.$
>     RewriteRule ^(.*)$ %{ENV:myproto}://%1$1 [R=301,L]

Do you have mod_rewrite enabled?

    dot 3 % fgrep mod_rewrite  /usr/local/etc/apache24/httpd.conf
    LoadModule rewrite_module libexec/apache24/mod_rewrite.so

		Craig





More information about the dns-operations mailing list