# Default VirtualHost
<VirtualHost _default_:80>
#DocumentRoot
DocumentRoot /var/www/html
# Log level
LogLevel warn
# Show apache signature
ServerSignature On
</VirtualHost>
01_example_vhost.conf
# example alias
<IfModule mod_alias.c>
Alias /example /var/www/example
</IfModule>
# example directory rights
<Directory /var/www/example>
# Limit bandwith if mod_bw is avaible
<IfModule mod_bw.c>
#Enable module
BandWidthModule On
#Force limit
ForceBandWidthModule On
#Set no limit
BandWidth all 0
#Limit Large file > 10MB to 30KB/s max
LargeFileLimit * 10240 30720
</IfModule>
# Allow from all
Order deny,allow
Allow from all
# Allow index and symlink
Options Indexes SymLinksifOwnerMatch
# Deny .htaccess
AllowOverride None
</Directory>
# example virtualhost
<VirtualHost *:80>
# Virtualhost domaine name
ServerName example.example.com
# DocumentRoot dir
DocumentRoot /var/www/example
# Log level
LogLevel warn
# Show apache signature
ServerSignature On
</VirtualHost>
[^] # Re: réecriture d'url réussie, mais inconvénients majeures!
Posté par Raphaël G. (site web personnel) . En réponse au message apache 1.33: afficher l'url correspondant au nom de domaine ... comment?. Évalué à 2.
- entrée dns pour le sous-domaine
- virtualhost dans apache correspondant.
Ici j'ai ça :
00_default_vhost.conf
# Use name-based virtual hosting.
NameVirtualHost *:80
# html dir perm
<Directory /var/www/html>
# Allow from all
Order deny,allow
Allow from all
# Allow index and symlink
Options Indexes SymLinksifOwnerMatch
# Deny .htaccess
AllowOverride None
# Rewrite url
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/noexist_.*\.html$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !/robots\.txt$
RewriteRule ^.* index.php [L]
RewriteCond %{REQUEST_URI} !^/noexist_.*\.html$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.* robots.txt [L]
</IfModule>
</Directory>
# Default VirtualHost
<VirtualHost _default_:80>
#DocumentRoot
DocumentRoot /var/www/html
# Log level
LogLevel warn
# Show apache signature
ServerSignature On
</VirtualHost>
01_example_vhost.conf
# example alias
<IfModule mod_alias.c>
Alias /example /var/www/example
</IfModule>
# example directory rights
<Directory /var/www/example>
# Limit bandwith if mod_bw is avaible
<IfModule mod_bw.c>
#Enable module
BandWidthModule On
#Force limit
ForceBandWidthModule On
#Set no limit
BandWidth all 0
#Limit Large file > 10MB to 30KB/s max
LargeFileLimit * 10240 30720
</IfModule>
# Allow from all
Order deny,allow
Allow from all
# Allow index and symlink
Options Indexes SymLinksifOwnerMatch
# Deny .htaccess
AllowOverride None
</Directory>
# example virtualhost
<VirtualHost *:80>
# Virtualhost domaine name
ServerName example.example.com
# DocumentRoot dir
DocumentRoot /var/www/example
# Log level
LogLevel warn
# Show apache signature
ServerSignature On
</VirtualHost>
etc...