Created
July 30, 2019 07:49
-
-
Save joduplessis/e20c5a2e2f97e8afe0a495bad8cd332e to your computer and use it in GitHub Desktop.
Rules for directing all subdomains to a folder (wildcard subdomains) - and exclude a specific subdomain, like dev.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<IfModule mod_rewrite.c> | |
Options +FollowSymLinks -MultiViews | |
RewriteEngine On | |
RewriteBase / | |
# Dev app sub domain masking | |
RewriteCond %{HTTP_HOST} ^dev\.yourdomain\.com$ [NC] | |
RewriteRule ^((?!dev/).*)$ /dev/$1 [L,NC] | |
# All sub domain masking | |
RewriteCond %{HTTP_HOST} ^([\w-]+)\.yourdomain\.com$ [NC] | |
RewriteRule ^(.*)$ /app/$1 [L,NC] | |
</IfModule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment