简体   繁体   English

如何将域名指向您站点内的子目录,并使其看起来像是一个单独的实体?

[英]How to point a domain name to a sub-directory within your site and have it so that it looks as if it is a separate entity?

I don't know much about htaccess which is why I've had to ask this question and apologies if there is an exact duplicate because I haven't seen one. 我对htaccess不太了解,这就是为什么我不得不问这个问题和道歉,如果有确切的重复,因为我没看过。

I have my domain abcdefg.co.uk and I bought another domain name 123456.info and pointed it to the same name servers for my existing hosting. 我有我的域名abcdefg.co.uk并购买了另一个域名123456.info并将其指向现有主机的相同名称服务器。

On my hosting account cpanel I created a new addon domain for 123456.info which created a subdirectory in my public_html directory. 在我的托管帐户cpanel上,我为123456.info创建了一个新的附加域,该域在我的public_html目录中创建了一个子目录。

So, when I try and navigate to 123456.info in my browser it takes me to abcdefg.co.uk/123456.info is there a way to rewrite or set it up differently so that it just appears as if it is a standalone site? 因此,当我尝试在浏览器中导航到123456.info时,将我带到abcdefg.co.uk/123456.info ,该方法可以用不同的方式重写或设置它,使其看起来像是一个独立站点?

Thanks for your help 谢谢你的帮助

(htaccess file is empty at the moment) (htaccess文件目前为空)

First of all: you can change root directory, so there will be no need to rewrite!!! 首先:您可以更改根目录,因此无需重写!!!
but if you see it easier , here it is: 但是,如果您觉得更简单,则为:

RewriteRule ^123456.info(.*)$    $1 [L]

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

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