一、修改httpd-conf文件

在phpStudy>Apache>conf下面的httpd.conf文件
搜索 #LoadModule rewrite_module modules/mod_rewrite.so
然后删除前面的#

如图:

使用phpstudy设置网站301重定向

二、.htaccess文件内容
rewriteEngine on
rewriteCond %{http_host} ^haishenzhishi.com [NC]
rewriteRule ^(.*)$ http://www.haishenzhishi.com/$1 [R=301,L]

直接创建.htaccess文件是不行的,会有提示,可以用文本ling另存为,如图:

使用phpstudy设置网站301重定向

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-16
  • 2022-12-23
  • 2021-05-17
  • 2022-12-23
  • 2021-11-09
猜你喜欢
  • 2021-11-19
  • 2022-12-23
  • 2021-12-06
  • 2021-05-15
  • 2021-07-16
  • 2021-04-21
  • 2022-12-23
相关资源
相似解决方案