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 @   泠风lj  阅读(146)  评论(0编辑  收藏  举报
编辑推荐:
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
阅读排行:
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
点击右上角即可分享
微信分享提示