1 [[email protected] ~]# /usr/local/apache2.4/bin/apachectl graceful
AH00526: Syntax error on line 43 of /usr/local/apache2.4/conf/extra/httpd-vhosts.conf:
RewriteRule: bad flag delimiters
原因 很简单 43行语法错误 RewriteRule ^/(. *)$ http://www.testdomain.com/$1 [R=301,L]
即 其实括号里面是没有空格的
注释:
10.14 apache 域名跳转

结果
[[email protected] ~]# curl -x127.0.0.1:80 -I testdomain.com
HTTP/1.1 301 Moved Permanently
Date: Wed, 14 Oct 2020 09:17:19 GMT
Server: Apache/2.4.43 (Unix) PHP/5.6.30
Location: http://www.testdomain.com/
Content-Type: text/html; charset=iso-8859-1

可以看见状态码301,跳转的网址是www.testdomain.com

相关文章:

  • 2021-08-27
  • 2022-01-02
  • 2021-09-12
  • 2021-08-27
  • 2022-01-23
  • 2021-12-24
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-08
  • 2021-09-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案