httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From YUSUI T <>
Subject [users@httpd] Redirection via HTTPS
Date Sun, 08 Feb 2015 03:30:15 GMT
I have a question about 301 redirection of https.

My website is accessible with both of non-subdomain http(s)://
and subdomain-www http(s):// Both have the same IP address.
I would like to change to redirection for
To change for redirecting all web contents under including
user directory /~user and so on, I tried to add the following to
/etc/apache2/mods-available/ssl.conf or

<IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteCond %{HTTP_HOST} ^(mydomain\.com)(:443)?
        RewriteRule (.*)$1 [R=301]

After this, I did do "service apache2 restart" of course.
But it looks like the redirection does not work.
What should I do?

In case of normal http, it works by adding the above to
/etc/apache2/sites-available/000-default.conf and

Apache version:2.4.7
OS:Ubuntu 14.04.1 LTS
Kernel:Linux 2.6.32-042stab093.5 #1 SMP

Thank you for your time and assistance.

Yusui Tomikawa

View raw message