Options ExecCGI FollowSymlinks Indexes IndexOptions NameWidth=* AllowOverride None Order allow,deny Allow from all DocumentRoot /var/www/oddb.org/doc/sl_errors ServerName sl_errors.oddb.org Options ExecCGI AllowOverride None Order allow,deny Allow from all Deny from 194.209.25.108 ErrorDocument 500 /var/www/oddb.org/doc/resources/errors/appdown.html ErrorDocument 503 /var/www/oddb.org/doc/resources/errors/appdown.html Order allow,deny Allow from all RewriteLock /var/lock/rewrite-lock ServerName oddb-ci2.dyndns.org RewriteLog "/var/log/apache2/rewrite.log" RewriteLogLevel 3 # Redirect permanent / https://oddb-ci2.dyndns.org # Above solution did not work # Neither the next four lines RewriteEngine On # This will enable the Rewrite capabilities RewriteCond %{HTTPS} !=on # This checks to make sure the connection is not already HTTPS RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L] # Redirect / https:///%{SERVER_NAME} # ProxyPreserveHost On DocumentRoot /var/www/oddb.org/doc ServerName oddb-ci2.dyndns.org #ServerAlias oddb-ci2.dyndns.org AddDefaultCharset UTF-8 ErrorDocument 503 /var/www/oddb.org/doc/resources/errors/appdown.html ErrorLog "| /usr/sbin/cronolog -l /var/www/oddb.org/log/oddb/error_log /var/www/oddb.org/log/oddb/%Y/%m/%d/error_log" CustomLog "| /usr/sbin/cronolog -l /var/www/oddb.org/log/oddb/access_log /var/www/oddb.org/log/oddb/%Y/%m/%d/access_log" combined ProxyPass /excluded ! ProxyPass / http://127.0.0.1:8012/ retry=0 ProxyPassReverse / http://127.0.0.1:8012/ SSLEngine on SSLCertificateFile /etc/letsencrypt/live/oddb-ci2.dyndns.org/cert.pem SSLCertificateKeyFile /etc/letsencrypt/live/oddb-ci2.dyndns.org/privkey.pem SSLCertificateChainFile /etc/letsencrypt/live/oddb-ci2.dyndns.org/fullchain.pem RequestHeader set SERVER_PORT "443" RewriteLog "/var/log/apache2/rewrite.log" RewriteLogLevel 3 RewriteEngine On # ports must be kept in sync between apache.conf and /service/ch.oddb-*crawler/run # rewrite rules for files RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_URI} -f RewriteRule ^/(.*)$ %{DOCUMENT_ROOT}/%{REQUEST_URI} [L,NC] RewriteRule /var/www/oddb.org/doc/resources/errors/appdown.html /var/www/oddb.org/doc/resources/errors/appdown.html [L] # Rewrite entries for google and other crawlers RewriteMap lc int:tolower RewriteCond %{HTTP_USER_AGENT} "google" RewriteRule ^/(.*)$ http://localhost:8112/$1 [P,L] RewriteCond %{HTTP_USER_AGENT} "archiver|slurp|bot|crawler|jeeves|spider|\.{6}" RewriteRule ^/(.*)$ http://localhost:8212/$1 [P,L] # Rewrite entries for mobile apps RewriteCond %{HTTP_USER_AGENT} iPhone RewriteRule ^/(..)/([^/]+)/(.*)$ http://i.ch.oddb.org/$1/mobile/$3 [R,L] RewriteCond %{HTTP_USER_AGENT} iPhone RewriteRule ^/(..)/([^/]+)/?$ http://i.ch.oddb.org/$1/ [R,L] RewriteCond %{HTTP_USER_AGENT} iPhone RewriteRule ^/(..)/?$ http://i.ch.oddb.org/$1/ [R,L] RewriteCond %{HTTP_USER_AGENT} iPhone RewriteRule ^/?$ http://i.ch.oddb.org/ [R,L] RewriteRule ^/(.*)$ http://localhost:8012/$1 [P] # Redirect Search-Engines RewriteRule ^/(..)/?$ /$1/ [PT] RewriteRule ^/(..)/(gcc)(.*) /$1/gcc$3 [PT] RewriteRule ^/(..)/([^/]*)/?(.*) http://$2.oddb.org/$1/$2/$3 [R,L] ## webalizer Options None AllowOverride None Order allow,deny Allow from all AuthUserFile /var/www/oddb.org/etc/htaccess AuthName "oddb.org statistics" AuthType Basic Require valid-user ServerName webalizer.oddb.org Redirect / http://webalizer.ch.oddb.org/ DocumentRoot /var/www/oddb.org/webalizer/oddb ServerName webalizer.ch.oddb.org DirectoryIndex index.html ## default virtual host for *.oddb.org needs to be at the end of the configuration ServerName oddb-ci2.dyndns.org # ServerName www.oddb.org # ServerAlias oddb.org www.ch.oddb.org *.oddb.org new.ch.oddb.org ramaze.ch.oddb.org RewriteEngine On RewriteCond {SERVER_PORT} =443 RewriteLog "/var/log/apache2/rewrite.log" RewriteLogLevel 3 # rewrite rules for files RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_URI} -f RewriteRule ^/(.*)$ %{DOCUMENT_ROOT}/%{REQUEST_URI} [L,NC] RewriteRule /var/www/oddb.org/doc/resources/errors/appdown.html /var/www/oddb.org/doc/resources/errors/appdown.html [L] # Rewrite entries for google and other crawlers RewriteMap lc int:tolower RewriteCond %{HTTP_USER_AGENT} "google" RewriteRule ^/(.*)$ http://localhost:8112/$1 [P,L] RewriteCond %{HTTP_USER_AGENT} "archiver|slurp|bot|crawler|jeeves|spider|\.{6}" RewriteRule ^/(.*)$ http://localhost:8212/$1 [P,L] # Rewrite entries for mobile apps RewriteCond %{HTTP_USER_AGENT} iPhone RewriteRule ^/(..)/([^/]+)/(.*)$ http://i.ch.oddb.org/$1/mobile/$3 [R,L] RewriteCond %{HTTP_USER_AGENT} iPhone RewriteRule ^/(..)/([^/]+)/?$ http://i.ch.oddb.org/$1/ [R,L] RewriteCond %{HTTP_USER_AGENT} iPhone RewriteRule ^/(..)/?$ http://i.ch.oddb.org/$1/ [R,L] RewriteCond %{HTTP_USER_AGENT} iPhone RewriteRule ^/?$ http://i.ch.oddb.org/ [R,L] RewriteRule ^/(.*)$ http://localhost:8012/$1 [P] RewriteRule ^/(..)/([^/]*)/?(.*) http://ch.oddb.org/$1/gcc/$3 [R,L] Redirect / http://ch.oddb.org/