Skip to content

Instantly share code, notes, and snippets.

@Jakiboy
Created April 4, 2023 20:47
Show Gist options
  • Save Jakiboy/8e80c6005cbbe3b8a9df88e6bfca5455 to your computer and use it in GitHub Desktop.
Save Jakiboy/8e80c6005cbbe3b8a9df88e6bfca5455 to your computer and use it in GitHub Desktop.
Vhost (Example)

Vhost (Example)

⚡ Configuration

<VirtualHost *:80>
  ServerAdmin webmaster@{domain}
  ServerName {domain}
  ServerAlias {sub}.{domain}
  DocumentRoot "/var/www/html/{domain}"
  DirectoryIndex index.php
  <Directory "/var/www/html/{domain}/">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
    AllowOverride All
    Require all granted
  </Directory>
  <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{SERVER_NAME} ={domain} [OR]
    RewriteCond %{SERVER_NAME} ={sub}.{domain}
    RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
  </IfModule>
  ErrorLog ${APACHE_LOG_DIR}/error.log
  CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Authors:

  • Jihad Sinnaour - Jakiboy (Initial work)

⭐ Support:

Please give it a Star if you like the project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment