Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to implement domain name forwarding in apache

Shulou Source: shulou.com Published: 2022-06-02 18:29:44 10月04日 Update

How to implement domain name forwarding in apache? Many novices are not very clear about this. In order to help you solve this problem, the following editor will explain it in detail. People with this need can come and learn. I hope you can gain something.

Apache installation, if you want to add modules, often do not want to reinstall, moreover, I found in the installation file is not all modules will be installed by default, this time I add forwarding module in the process, encountered some problems, in order not to take detours in the future, specially recorded.

Port forwarding function

# after RewriteEngine on RewriteCond% {REQUEST_METHOD} ^ (TRACE | TRACK) RewriteRule. *-[F] # the domain name of the address is not transferred to IP and port # RewriteCond% {REQUEST_METHOD}! ^ POST$ RewriteCond% {HTTP_HOST} ^ xx.com.cn RewriteRule ^ / (. *) http://xxx.xxx.xxx.xxx:9100/$1 [NC,NE,R=301 P] # after forwarding, the address will jump to IP and port RewriteCond% {HTTP_HOST} ^ c.xx.com.cn RewriteRule ^ / (. *) http://xxx.xxx.xxx.xxx:8001/$1 [NC,NE] RewriteRule ^ / a/b.html http://xxx.xxx.xxx.xxx:8002/a/b.html [NC P] # for example, RewriteEngine on RewriteCond% {REQUEST_METHOD} ^ (TRACE | TRACK) RewriteRule. *-[F] RewriteCond% {HTTP_HOST} ^ m.abc.com.cn RewriteRule ^ / (. *) http://xxx.xxx.xxx.xxx:8001/$1 [NC NE] does the DocumentRoot "/ var/www/html/mobile" Options FollowSymLinks IncludesNOEXEC Indexes DirectoryIndex index.html index.htm index.php AllowOverride All Order allow,deny Allow from all read the above content helpful to you? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

Tags: Port domain name address module help real clear content function this document article novice more knowledge industry information channel detour process Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Xiaomi Redmi Shulou Information NVidia