简体   繁体   English

如何将URL IP隐藏到子域名

[英]How to hide the url ip to sub domain name

I am new to this. 我是新来的。 I want to hide ip address/~foldername/ url to domain name url, so that the address in the url changes to new url but it should point to the same destination folder ? 我想将ip address /〜foldername / url隐藏为域名url,以便将url中的地址更改为新的url,但它应指向同一目标文件夹? need assistance 需要帮助

Thank you 谢谢

You need to set up a rewrite rule on www.domain.com/folder to redirect to example.domain.com (this is your new url change if you want another). 您需要在www.domain.com/folder上设置一个重写规则,以重定向到example.domain.com (如果需要,这是新的URL更改)。 Then set up example.domain.com to either lie about who and where it is, or fix all links in pages on example.domain.com to explicitly go to http://www.domain.com/folder . 然后将example.domain.com设置为关于谁和在哪里,或者将example.domain.com页面上的所有链接修复为explicitly go to http://www.domain.com/folder

In the root .htaccess file on www.domain.com: (to redirect to the subdomain) 在www.domain.com的根.htaccess文件中:(重定向到子域)

RewriteRule ^folder/(.*) http://example.domain.com/$1 [R, L]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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