Portál AbcLinuxu, 27. října 2025 16:24
ServerAdmin mujmail@gmail.com
# Global configuration for server
<Directory /var/www/>
Options -Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/access.log combined
# Other virtual Hosts
<VirtualHost *:80>
UseCanonicalName Off
DocumentRoot /var/www
ServerName *
# http://www.example.com/test.txt -> /var/www/example.com/www/test.txt
#VirtualDocumentRoot /var/www/%-2.0.%-1.0/%-3+/
VirtualDocumentRoot /var/www/%-2.0/www/
</VirtualHost>
# locahost
<VirtualHost *:80>
DocumentRoot /var/www
ServerName localhost
</VirtualHost>
Řešení dotazu:
# Apache configuration file (see httpd.apache.org/docs/2.2/mod/quickreference.html)
#php_flag eaccelerator.enable 0
#php_flag eaccelerator.optimizer 0
# disable directory listing
Options -Indexes
# Forbidden access to neon
<Files config.neon>
order allow,deny
deny from all
</Files>
# enable cool URL
<IfModule mod_rewrite.c>
RewriteEngine On
#RewriteBase /
# front controller
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule !\.(pdf|js|ico|gif|jpg|png|css|rar|zip|tar\.gz)$ index.php [L]
</IfModule>
# enable gzip compression
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/x-javascript text/javascript application/javascript application/json
</IfModule>
# allow combined JavaScript & CSS. Inside of script.combined.js you could use <!--#include file="script.js" -->
#<IfModule mod_include.c>
# <FilesMatch "\.combined\.(js|css)$">
# Options +Includes
# SetOutputFilter INCLUDES
# </FilesMatch>
#</IfModule>
Pokud zadám např. /login (není souborem ani adresářem), má se načíst index.php?
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.