1
내 웹 공간에 /
및 /sub
이 있습니다.
하위 도메인 sub.example.com
은 그의 데이터를 /sub
에서 가져옵니다.
/
에는 Joomla 설치가 있고 .htaccess
이 있습니다.하위 도메인에 다시 작성하고 다시 다시 작성하십시오.
으로 먼저 나는 sub.example.com
sub.example.com/index.html
로 인한 유지 보수에 /sub
sub.example.com
와 같은 초 모든 액세스에 대한 모든 액세스를 리디렉션 할.
나는
RewriteEngine on
RewriteRule ^sub(.*)? http://sub.example.com$1 [R=301,L]
를 통해 sub.example.com
에 /sub
에 대한 모든 액세스를 리디렉션 할 수 있습니다하지만 /sub/.htaccess
에 다음과 같은 규칙을 사용하면 규칙은 위의 실패합니다.
RewriteEngine on
RewriteCond %{REQUEST_URI} !index\.html
RewriteRule .* /index.html
그 때문에 /sub/.htaccess
에서 두 번째로 재 작성의 건 알지만 어떻게 위의 재 작성을 할 수 있습니까?
/.htaccess
에 다음과 같은 규칙을 시도하지만
/sub/.htaccess
에
RewriteEngine On
RewriteRule ^sub(.*)? http://sub.example.com$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^sub.example.com$
RewriteCond %{REQUEST_URI} !index\.html
RewriteRule .* index.html [L]
리디렉션이 작동하지 않습니다. 또한 Joomla의'.htaccess'를 비활성화 한 경우 – criztovyl
지금 편집 된 코드를 사용해보십시오. – anubhava
이제 작동합니다. – criztovyl