Skip to content

Instantly share code, notes, and snippets.

@cointilt
Created December 9, 2011 21:42
Show Gist options
  • Save cointilt/1453427 to your computer and use it in GitHub Desktop.
Save cointilt/1453427 to your computer and use it in GitHub Desktop.
WordPress htaccess environment setup
RewriteEngine On
RewriteBase /
### SET UP ENVIRONMENT ###
RewriteRule .* - [E=ENVIRONMENT:production]
RewriteCond %{SERVER_NAME} localhost [OR]
RewriteCond %{SERVER_NAME} .dev$ [OR]
RewriteCond %{SERVER_NAME} .local$
RewriteRule .* - [E=ENVIRONMENT:dev]
RewriteCond %{SERVER_NAME} ^stage.
RewriteRule .* - [E=ENVIRONMENT:stage]
### Start Rewrites ####
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment