Ali's normal version of the virtual cloud host can only build one site, but can bind multiple domain names. What if we want to create a 2 or 3 host? Do I need to buy another host?
In fact, we can use the. htaccess file to define the corresponding site directory for the associated domain name bindings, so that multiple sites are hung on a single host.
In addition, Ali virtual host can also be customized. htaccess files, we only need to connect via FTP, tick " Force Show hidden files " can be seen in the site root directory.
Using the FTP tool, right-click to edit the file:
Default content Template (archive):
Rewriteengine on<ifmodule mod_rewrite.c>rewriteengine onrewritebase/rewriterule ^index\.php$-[L]RewriteCond% {request_filename}!-frewritecond%{request_filename}!-drewriterule. /index.php [l]</ifmodule>
Domain Name Jump method:
Rewriteengine on<ifmodule mod_rewrite.c>rewriteengine Onrewritecond%{http_host} ^blog.abc.com [NC] RewriteRule ^ (. *) $ http://abc.com/blog/$1 [l,r=301]</ifmodule>
Two-level domain name binding/mapping to a subdirectory method:
Example:
Rewriteengine onrewritebase/# Mapping aaa.test.com to AAA directory Rewritecond%{http_host} ^aaa.test.com$rewritecond%{REQUEST_URI} !^/aaa/rewriterule ^ (. *) $ aaa/$1# Map bbb.test.com to BBB directory Rewritecond%{http_host} ^bbb.test.com$rewritecond%{request_ URI}!^/bbb/rewriterule ^ (. *) $ bbb/$1
I am using the template:
Rewriteengine on# BEGIN wordpress<ifmodule mod_rewrite.c>rewriteengine onrewritebase/rewriterule ^index\.php$- L Rewritecond%{request_filename}!-frewritecond%{request_filename}!-drewriterule. /index.php [l]# binding a.abc.com to New subdirectory Rewritecond%{http_host} ^a.abc.com$ [Nc]rewritecond%{request_uri}!^/new/ Rewriterule ^ (. *) $ new/$1 [l,qsa]</ifmodule># END WordPress
Virtual Cloud Host creates multiple site methods (. htaccess implementation)