荣耀之链论坛

 找回密码
 立即注册
搜索
查看: 1861|回复: 0

apache

[复制链接]

1325

主题

2372

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
10262
发表于 2019-1-21 17:07 | 显示全部楼层 |阅读模式
网页重定向
  1. <Directory "/var/www/html">
  2.     #
  3.     # Possible values for the Options directive are "None", "All",
  4.     # or any combination of:
  5.     #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
  6.     #
  7.     # Note that "MultiViews" must be named *explicitly* --- "Options All"
  8.     # doesn't give it to you.
  9.     #
  10.     # The Options directive is both complicated and important.  Please see
  11.     # http://httpd.apache.org/docs/2.4/mod/core.html#options
  12.     # for more information.
  13.     #
  14.     Options Indexes FollowSymLinks

  15.     #
  16.     # AllowOverride controls what directives may be placed in .htaccess files.
  17.     # It can be "All", "None", or any combination of the keywords:
  18.     #   Options FileInfo AuthConfig Limit
  19.     #这里改为all就表示开启重定向
  20.     AllowOverride all

  21.     #
  22.     # Controls who can get stuff from this server.
  23.     #
  24.     Require all granted
  25. </Directory>
复制代码




虚拟主机
  1. NameVirtualHost *:80

  2. <VirtualHost *:80>
  3.     ServerAdmin 648473061@qq.com
  4.     DocumentRoot /var/www/html/rongyaozhilian/www
  5.     ServerName www.ryzl.com.cn
  6.     ErrorLog logs/www.ryzl.com.cn-error_log
  7.     CustomLog logs/www.ryzl.com.cn-access_log common
  8. #下面的重定向表示直接把域名里面的www.ryzl.com.cn替换成w.ryzl.com.cn:9999
  9. RewriteEngine on
  10. RewriteCond %{SERVER_NAME} =www.ryzl.com.cn
  11. RewriteRule ^ http://w.ryzl.com.cn:9999%{REQUEST_URI} [END,NE,R=permanent]
  12. </VirtualHost>
复制代码


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

荣耀之链

GMT+8, 2025-6-18 02:22 , Processed in 0.013105 second(s), 20 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表