配置步骤如下:
一、开启.htaccess文件
在apache的conf文件中,打开打开httpd.conf
1、把文档中所有的AllowOverride None全部的都给换成AllowOverride All
<Directory />
Options FollowSymLinks
AllowOverride all
Order deny,allow
Deny from all
Deny from env=BT
</Directory>
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride ALL
2、去掉下面的注释
LoadModule rewrite_module modules/mod_rewrite.so
一、.htaccess 简单的写法
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^.*szbq.net [NC]
RewriteRule ^(.*)$ http://www.szbq.net/$1 [L,R=301]
ErrorDocument 404 /404.html
RewriteEngine On
RewriteBase /
RewriteRule ^(.*)\.(asp|aspx|asa|asax|dll|jsp|cgi|fcgi|pl)(.*)$ /404.html
RewriteRule ^(.*)/file/(.*)\.php(.*)$ /404.html
RewriteCond %{http_host} ^szbq.com [NC]
RewriteRule ^(.*)$ http://www.szbq.com/$1 [L,R=301]
附件下载
http://www.szbq.net/uploadfile/2013/0205/20130205065042493.zip