Skip to content

Instantly share code, notes, and snippets.

@xeoncross
Created October 3, 2011 16:21
Show Gist options
  • Save xeoncross/1259505 to your computer and use it in GitHub Desktop.
Save xeoncross/1259505 to your computer and use it in GitHub Desktop.
Basic server vhost
<VirtualHost *:80>
ServerName domain.tld
ServerAdmin [email protected]
DocumentRoot /var/www/domain.tld/
# mod_rewrite rules
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [QSA,L]
</VirtualHost>
server
{
listen 80;
server_name domain.tld;
root /home/user/www/domain.tld;
# Route all requests for non-existent files to index.php
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php/$1 last;
}
# Pass PHP scripts to php-fastcgi listening on port 9000
location ~ \.php {
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment