Is it possible to mirror a directory content using apache htaccess files? I'm on virtual hosting with cPanel so do not have root access and want to avoid double copies of the same file on my hosting account. For example, what I'm trying to do, for example, there are two subdomains:
files.abc.com files.123.com
abc.com and 123.com Different Web sites will be Differen't html, but when you go to the files subdomain they will be similar. I want a subdomain to show the same directory of files if you tell me what? How it can be obtained, its other suggestions will be appreciated. thank you in advanced.
It depends on whether you have 2 domain setup and any details of how your hosting is being done. A simple way to do this without knowing is to point each other to the other domain's .htaccess file to use an internal proxy (where files.abc.com is being hosted):
Reviving OnRightRound% {HTTP_HOST} ^ Files .abc \ .com $ [NC] Revrovarial ^ (. *) $ Http://files.123.com/$1 [P] L] Here, we have files sitting in the host files.123.com , which means that we can be here. But with this rule, you can go and it will proxy internally on 123.com host. If both domains are pointing to the same host in the domain, and you have a rule or CPL, set up subdomain for 123.com:
Rewrite% {HTTP_HOST} ^ Files \ .123 \ .com $ [NC] rewrite% {REQUEST_FILENAME}! -f rewrite% {REQUEST_FILENAME}! -D RewriteRule ^ (. *) $ / Where-where-where -123.com -files-really-is / $ 1 [L] Or something similar in cpanel either way From, the request for files.123.com is served by the directory / here-are-where -123.com-files-really-are / . You must include a set of rules to adjust for the files of the other files and they must be in the .htaccess file in their document root: RewriteCond% {HTTP_HOST} ^ files \ ABC \ .com $ [NC] rewrite% {REQUEST_FILENAME}! -FREVRATKOWN% {REQUEST_FILENAME}! -D rewriteAril. ^ (. *) $ / Somewhere-where-where -123.com-files-rely-year / $ 1 [L]
Comments
Post a Comment