Thread: Apache wildcard subdomain woes..
so have apache server set rewrite force ssl connections , wildcard subdomains. issue having wildcard subdomains if enter them without https:// in browser, www added when redirected ssl. example, if enter
http://test.example.com
redirects to
https://www.test.example.com
not how want work.
here default , default-ssl server configs:
default:
default-ssl:code:<virtualhost *:80> serveradmin webmaster@localhost virtualdocumentroot /var/www/%0/ scriptalias /cgi-bin/ /usr/lib/cgi-bin/ errorlog ${apache_log_dir}/error.log # possible values include: debug, info, notice, warn, error, crit, # alert, emerg. loglevel warn customlog ${apache_log_dir}/access.log combined alias /doc/ "/usr/share/doc/" rewriteengine on rewritecond %{https} off rewritecond %{http_host} ^www\.(.*)$ [nc] rewriterule ^(.*)$ https://%1/$1 [r=302,l,qsa] </virtualhost>
and httpd.conf:code:<virtualhost *:443> serveradmin webmaster@localhost servername *.example.com (replaced privacy) sslengine on sslcertificatefile /etc/ssl/server.crt sslcertificatekeyfile /etc/ssl/server.key sslprotocol sslciphersuite high:medium virtualdocumentroot /var/www/%0/ </virtualhost>
any suggestions appreciated. have tried multiple rewrite rules in ssl virtual host remove www have not been helpful.code:servername example.com <directory /var/www/sub.example.com> authtype basic authname "authorized users only" authuserfile /etc/***/***.passwd <limit put post> require valid-user </limit> </directory>
i haven't used rewritecond, purpose of
might source of problem?code:rewritecond %{http_host} ^www\.(.*)$ [nc]
use redirect this:
code:<virtualhost *:80> servername test.example.com redirect / https://test.example.com/ </virtualhost>
Forum The Ubuntu Forum Community Ubuntu Specialised Support Ubuntu Servers, Cloud and Juju Server Platforms [ubuntu] Apache wildcard subdomain woes..
Ubuntu
Comments
Post a Comment