求助:apache重定向不存在的文件到存在的文件而不是返回404?
moxnet
|
1#
moxnet 发表于 2006-12-15 10:16
求助:apache重定向不存在的文件到存在的文件而不是返回404?
apache v2.2.3
现在忽然发现这个问题,比如虚拟主机下有Man_Patch1212.exe这个文件,不存在Man_Patch1215.exe,而我请求Man_Patch1215.exe时,会重定向到Man_Patch1212.exe而不是返回404(看下面的wget中的HTTP request sent, awaiting response... 301 Moved Permanently一行,里面有301重定向),我没有在里面写过rewrite规则,apache为什么会偷偷的给我重定向?我不要让他重定向哈~~~ 注:目录下没有.htaccess文件 编译的模块(许多模块并没有用,在配置文件中注释掉了):
[Copy to clipboard] [ - ]
CODE:
# /usr/local/apache/bin/apachectl -l
Compiled in modules: core.c mod_authn_file.c mod_authn_default.c mod_authz_host.c mod_authz_groupfile.c mod_authz_user.c mod_authz_default.c mod_auth_basic.c mod_include.c mod_filter.c mod_log_config.c mod_logio.c mod_env.c mod_setenvif.c prefork.c http_core.c mod_mime.c mod_status.c mod_autoindex.c mod_asis.c mod_cgi.c mod_negotiation.c mod_dir.c mod_actions.c mod_speling.c mod_userdir.c mod_alias.c mod_so.c
[Copy to clipboard] [ - ]
CODE:
[root@downloadsvr ~]# wget http://my.host.com/Man_Patch1215.exe
--10:07:23-- http://my.host.com/Man_Patch1215.exe => `Man_Patch1215.exe' Resolving my.host.com... 1.1.1.1 Connecting to my.host.com|1.1.1.1|:80... connected. HTTP request sent, awaiting response... 301 Moved Permanently Location: http://my.host.com/Man_Patch1212.exe [following] --10:07:45-- http://my.host.com/Man_Patch1212.exe => `Man_Patch1212.exe' Connecting to my.host.com|1.1.1.1|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 344,569,497 (329M) [application/octet-stream] 0% [ ] 671,744 252.70K/s 我的配置文件:
[Copy to clipboard] [ - ]
CODE:
ServerRoot "/usr/local/apache"
Listen 80 <IfModule !mpm_netware_module> User daemon Group daemon </IfModule> ServerAdmin support@my.host ServerName 127.0.0.1:80 DocumentRoot "/var/www/html" <Directory /> Options FollowSymLinks AllowOverride None Order deny,allow Deny from all </Directory> <Directory "/var/www/html"> Options FollowSymLinks AllowOverride None Order allow,deny Allow from all </Directory> <IfModule dir_module> DirectoryIndex index.html </IfModule> <FilesMatch "^\.ht"> Order allow,deny Deny from all Satisfy All </FilesMatch> ErrorLog logs/error_log LogLevel warn <IfModule log_config_module> LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "%h %l %u %t \"%r\" %>s %b" common <IfModule logio_module> LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio </IfModule> CustomLog logs/access_log common </IfModule> <IfModule alias_module> </IfModule> DefaultType text/plain <IfModule mime_module> TypesConfig conf/mime.types AddType application/x-compress .Z AddType application/x-gzip .gz .tgz </IfModule> <IfModule ssl_module> SSLRandomSeed startup builtin SSLRandomSeed connect builtin </IfModule> CheckSpelling on LoadModule cband_module modules/mod_cband.so LogFormat "%h\t%{%s}t\t1\t1\t%>s\t-\t%O\t%m\thttp://%v%U\t%u\t-\t-\t-\t-\t-\t%{Referer}i\t%{User-Agent}i\t" myformat Timeout 30 KeepAlive Off UseCanonicalName Off AccessFileName .htaccess ServerTokens Minimal ServerSignature Off HostnameLookups Off <IfModule !mpm_netware_module> PidFile logs/httpd.pid </IfModule> <IfModule !mpm_winnt_module> <IfModule !mpm_netware_module> LockFile logs/accept.lock </IfModule> </IfModule> <IfModule mpm_prefork_module> ServerLimit 2000 StartServers 5 MinSpareServers 5 MaxSpareServers 10 MaxClients 1500 MaxRequestsPerChild 1000 </IfModule> <IfModule mpm_worker_module> ServerLimit 25 StartServers 2 MaxClients 500 MinSpareThreads 25 MaxSpareThreads 75 ThreadsPerChild 25 MaxRequestsPerChild 1000 </IfModule> NameVirtualHost *:80 <Location /cband-status> SetHandler cband-status </Location> <VirtualHost *:80> DocumentRoot /var/www/html ServerName 127.0.0.1 CustomLog logs/access_log combined ErrorLog logs/error_log </VirtualHost> <VirtualHost *:80> DocumentRoot /var/www/html/host ServerName my.host.com CBandRemoteSpeed 250kb/s 3 3 CustomLog logs/access.log myformat </VirtualHost> |