내 사이트의 하위 폴더를 하위 도메인으로 지정하려고합니다. 예를 들어 www.domain.com/test에서 test.domain.com으로 변경하려고합니다. 이미 사이트 구축 프로세스에서 이전에 사용한 개발자가 수행 한 htaccess에서 일부 재 작성이 있습니다. 이러한 작업을 방해하지 않고이 행을 추가 할 수 있기를 바랍니다.하위 디렉토리를 htaccess의 하위 도메인으로 사용
인터넷에서 발견 된이 문제에 대한 수십 가지 답변을 시도했지만 그 중 아무 것도 작동하지 않는 것으로 보였습니다.이 언어에 대한 지식이 부족하거나 충돌이있는 경우 확실하지 않습니다. 다른 것. 내가 시도
최신 라인은 다음과 같습니다
RewriteCond %{HTTP_HOST} !^www.domain.tv
RewriteCond %{HTTP_HOST} ([^.]+).domain.tv
RewriteRule ^(.*)$ /var/www/www.domain.tv/test%1
이 내 현재 htaccess로 파일입니다
Options +FollowSymLinks
RewriteEngine On
RewriteBase/
#RewriteCond %{HTTP_HOST} !www\.domain\.tv$ [NC]
#RewriteCond %{HTTP_HOST} ^(.+)\.domain\.tv$ [NC]
#RewriteRule .* index.php?option=com_contushdvideoshare&view=player&Itemid=33 [L]
RewriteCond %{REQUEST_URI} ^/album\/t\/([a-zA-Z0-9]+) [NC]
RewriteRule ^album/t/(.*) index.php?option=com_usermenu&task=directdownload&id=$1&type=one$
RewriteCond %{REQUEST_URI} ^/album\/([a-zA-Z0-9]+) [NC]
RewriteRule ^album/(.*) index.php?option=com_usermenu&task=directdownload&id=$1 [L]
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
RewriteRule .* index.php [F]
#RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteCond %{REQUEST_URI} !^/index\.php
RewriteCond %{REQUEST_URI} (/[^.]*|\.(php|html?|feed|pdf|raw))$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php [L]
사람이 여기 좀 도와 줄래?
URL이 다음과 같이 표시됩니다. http://www.domain.tv/testest – user1429324
원하는 내용을 잘 모름 - 규칙에서 테스트를 제거했습니다. 지금 해봐? – Ansari
www.domain.tv/test가 test.domain.tv로 표시되고 작동하도록 지정하고 싶습니다. 나는 다른 하위 도메인을 막고있는 htaccess 파일에 다른 줄이있을 것이라고 생각합니다. 도와 줘서 고마워! – user1429324