简体   繁体   中英

Different URL based on same server but different DNS entry

We have a server, say 192.168.1.5, and we have two DNS entries for it:

server.domain.com ftplogs.domain.com

Both of which point to the server's IP.

I'd want to have server.domain.com redirect to server.domain.com/page1, and I'd like to have ftplogs.domain.com redirect to ftplogs.domain.com/logs.

Any ideas on how to pull this off? Have been fighting with mod_rewrite rules for a bit now.

Thanks!

you can try it:

<VirtualHost *:80>
    ServerName server.domain.com
    RewriteEngine On
    Redirect / http://server.domain.com/page1
</VirtualHost>


<VirtualHost *:80>
    ServerName ftplogs.domain.com
    RewriteEngine On
    Redirect / http://ftplogs.domain.com/logs
</VirtualHost>

This work for me :-)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM