首页> 技术文章 > 技术 > 正文 SEO优化基础

PHP配置301重定向跳转设置+404错误页面

2013-02-05 18:44:39   来源:博强网络   评论:0 点击:
配置步骤如下:一、开启.htaccess文件在apache的conf文件中,打开打开httpd.conf1、把文档中所有的AllowOverride None全部的都给换成AllowOverride All<Directory /> Options FollowSymLinks AllowOverrid...

配置步骤如下:

一、开启.htaccess文件

apacheconf文件中,打开打开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





 

相关热词搜索:配置 301+404 错误
延伸阅读
技术

友情链接

服务电话: 0722-7113736 作息时间:周一至周五 8:30-17:50

CopyRight © 2010-2012 版权所有:随州博强网络科技 

洒水车 www.szbq.net 随州生活宝 汽车公告 地址: 随州市时代广场C区115号  随州博强网络科技