Created
September 9, 2009 07:24
-
-
Save crofty/183537 to your computer and use it in GitHub Desktop.
Apache URL rewrite
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
# Enabling URL rewriting with apache | |
sudo a2enmod rewrite | |
# Edit /etc/apache2/apache2.conf | |
RewriteEngine On | |
# Edit the vhosts in /etc/apache2/sites-available. e.g. | |
<VirtualHost *:80> | |
ServerName domain.com | |
ServerAlias www.domain.com | |
RewriteCond %{HTTP_HOST} ^domain\.com | |
RewriteRule (.*) http://www.domain.com$1 [R=301,L] | |
DocumentRoot /var/www/apps/app/current/public | |
</VirtualHost> | |
# Restart Apache | |
sudo /etc/init.d/apache2 restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment