|
网页重定向
- <Directory "/var/www/html">
- #
- # Possible values for the Options directive are "None", "All",
- # or any combination of:
- # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
- #
- # Note that "MultiViews" must be named *explicitly* --- "Options All"
- # doesn't give it to you.
- #
- # The Options directive is both complicated and important. Please see
- # http://httpd.apache.org/docs/2.4/mod/core.html#options
- # for more information.
- #
- Options Indexes FollowSymLinks
- #
- # 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
- #这里改为all就表示开启重定向
- AllowOverride all
- #
- # Controls who can get stuff from this server.
- #
- Require all granted
- </Directory>
复制代码
虚拟主机
- NameVirtualHost *:80
- <VirtualHost *:80>
- ServerAdmin 648473061@qq.com
- DocumentRoot /var/www/html/rongyaozhilian/www
- ServerName www.ryzl.com.cn
- ErrorLog logs/www.ryzl.com.cn-error_log
- CustomLog logs/www.ryzl.com.cn-access_log common
- #下面的重定向表示直接把域名里面的www.ryzl.com.cn替换成w.ryzl.com.cn:9999
- RewriteEngine on
- RewriteCond %{SERVER_NAME} =www.ryzl.com.cn
- RewriteRule ^ http://w.ryzl.com.cn:9999%{REQUEST_URI} [END,NE,R=permanent]
- </VirtualHost>
复制代码
|
|