Created
February 14, 2010 05:41
-
-
Save michaeltroy/303867 to your computer and use it in GitHub Desktop.
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
# When developing a static website we want to deploy two copies. The | |
# first is the staging copy and the second is the live production copy. | |
# The staging copy will be deployed to the following directory: | |
# 'http://website.com/development/current/index.php' | |
# The production copy will be deployed to the following directory: | |
# 'http://website.com/home/current/index.php' | |
# The directory paths need to be rewritten like so: | |
# 'http://website.com/development/current/index.php' should now look like | |
# 'http://website.com/development/' | |
# 'http://website.com/home/current/index.php' should now look like | |
# 'http://website.com' | |
# Note: 'current' is a symlinked directory. | |
# so far I have the production copy working correctly but not development. | |
# ------------------------------------------------------------------------# | |
RewriteEngine On | |
# Remove the www | |
RewriteBase / | |
RewriteCond %{HTTP_HOST} !^website.com$ [NC] | |
RewriteRule ^(.*)$ http://website.com/$1 [L,R=301] | |
# Rewrite 'home/current/' to 'website.com' | |
RewriteCond %{HTTP_HOST} ^website.com$ | |
RewriteCond %{REQUEST_URI} !^/home/current/ | |
RewriteRule (.*) /home/current/$1 | |
# 404 redirect | |
ErrorDocument 404 /404.php | |
# ------------------------------------------------------------------------# |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment