Skip to content

Instantly share code, notes, and snippets.

@Drethic
Created October 8, 2019 13:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Drethic/cf30dda98dedfb8b265ed16849bd1b7c to your computer and use it in GitHub Desktop.
Save Drethic/cf30dda98dedfb8b265ed16849bd1b7c to your computer and use it in GitHub Desktop.
PHP site.conf httpd config
# With www forced redirect
<VirtualHost *:80>
ServerName http://www.example.com
RewriteEngine On
RewriteCond %{HTTP_HOST} !^(www)\.(example.com)$ [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
DocumentRoot /var/www/examplecom
ErrorLog /var/log/httpd/examplecom_error.log
<Directory "/var/www/examplecom">
AllowOverride All
</Directory>
</VirtualHost>
# Without www forced redirect
<VirtualHost *:80>
ServerName htt://example.com
DocumentRoot /var/www/examplecom
ErrorLog /var/log/httpd/examplecom.log
<Directory "/var/www/examplecom">
AllowOverride All
</Directory>
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment