Created
October 8, 2019 13:53
-
-
Save Drethic/cf30dda98dedfb8b265ed16849bd1b7c to your computer and use it in GitHub Desktop.
PHP site.conf httpd config
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
# 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