Skip to content

Instantly share code, notes, and snippets.

@Psmths
Last active February 6, 2021 06:42
Show Gist options
  • Save Psmths/e0272236b9f831b9bfa36bf76e1934c0 to your computer and use it in GitHub Desktop.
Save Psmths/e0272236b9f831b9bfa36bf76e1934c0 to your computer and use it in GitHub Desktop.
Apache Catch-All HTTP Redirect

Apache Catch-All HTTP Redirect

Use this virtual host configuration to redirect traffic from HTTP to HTTP/S for multiple subdomains.

<VirtualHost *:80>
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^(.*)$ [NC]
    RewriteRule ^ https://%1%{REQUEST_URI} [L,NE,R=301]
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment