Skip to main content

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:

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>
default-ssl:
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>
and httpd.conf:
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>
any suggestions appreciated. have tried multiple rewrite rules in ssl virtual host remove www have not been helpful.

i haven't used rewritecond, purpose of

code:
rewritecond %{http_host} ^www\.(.*)$ [nc]
might source of problem?

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

Popular posts from this blog

Thread: Can not create raid array: mdadm: no raid-devices specified.

Thread: HOW TO: Package and theme GTK+ / Gtkmm apps in Linux for Windows

Thread: Twinview issues