.htaccess to create dynamic subdomain from subfolder -
I wonder how a dynamic subdomain can point to the root folder when the user searches for it. Like apples.domain.com, pointing to domain.com/apples (apple folder is already manually created), then if the apple folder does not exist, it receives 404. Please help, I am a Noah with this topic.
Try:
rewrite on the rewriting engine %% {HTTP_HOST }! ^ Www. [NC] RevokedContact% {HTTP_HOST} ^ ([^.] +) \. Domain \ .com $ [NC] REVIRCURD% {DOCUMENT_ROOT} /% 1! -D reveritium ^ - [L, R = 404] referenced% {HTTP_HOST}! ^ Www. [NC] RevokedContact% {HTTP_HOST} ^ ([^.] +) \. Domain \ com [nc] rewrite code% {DOCUMENT_ROOT} /% 1-D recriminator% {DOCUMENT_ROOT} /% 1% {REQUEST_FILENAME} -f [or] Rewrite% {DOCUMENT_ROOT} /% 1% {REQUEST_FILENAME} -d Revert Raul ^ (. *) $ /% 1 / $ 1 [L] The document root of domain.com in the htaccess file.
Comments
Post a Comment