301重定向

重定向检测

http://tool.chinaz.com/pagestatus/

 

重定向方法

 

 

方法1

https://www.itbulu.com/apache-htaccess.html

方法2-------X

https://blog.csdn.net/ldm19880906/article/details/55211483

方法3

https://blog.csdn.net/github_26672553/article/details/51888261#commentBox

 

 

 

Apache

 环境:
系统 Windows
Apache 2.2
 

加载Rewrite模块:

在conf目录下httpd.conf中找到

LoadModule rewrite_module modules/mod_rewrite.so

这句,去掉前边的注释符号“#”,或添加这句。

允许在任何目录中使用“.htaccess”文件,将“AllowOverride”改成“All”(默认为“None”):

# 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

在Windows系统下不能直接建立“.htaccess”文件,可以在命令行下使用“echo a> .htaccess”建立,然后使用记事本编辑 
 
.htaccess内容
 
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.wxtp111.com [NC]
RewriteRule ^(.*)$ http://wxtp111.com/$1 [L,R=301]
</IfModule>

 

posted @ 2018-10-23 17:31  泠风lj  阅读(145)  评论(0编辑  收藏  举报