을 보여 htaccess로를 구성하는 방법 : 같은 가상 둘째 하위 도메인에 대한 특정 페이지를 리디렉션 또는 표시 할 수 있도록 : virtual.hotels.sample.com나는이 목표를 가지고 동적 두 번째 하위 도메인
을하고 난이 있습니다 htaccess 규칙이 작성된
RewriteEngine On
Options +FollowSymlinks -Indexes
RewriteBase/
RewriteCond %{HTTP_HOST} !^hotels.sample\.com$
RewriteCond %{HTTP_HOST} ^(.*?)\.(www\.)?hotels.sample\.com$ [NC]
RewriteRule (.*) http://hotels.sample.com/$1 [R=301,L]
RewriteRule ^cheap-hotels-country/([A-Za-z0-9]+)/([A-Za-z0-9]+)\/?$ index.php?country=$1&custom=$2 [L]
RewriteRule ^cheap-hotels-city/([A-Za-z0-9]+)/([A-Za-z0-9]+)\/?$ index.php?city=$1&custom=$2 [L]
RewriteRule ^cheap-hotels-country/([A-Za-z0-9]+)\/?$ index.php?country=$1 [L]
RewriteRule ^cheap-hotels-city/([A-Za-z0-9]+)\/?$ index.php?city=$1 [L]
RewriteRule ^find-cheap-hotels-country/([A-Za-z0-9]+)/([A-Za-z0-9]+)\/?$ index2.php?country=$1&custom=$2 [L]
RewriteRule ^find-cheap-hotels-city/([A-Za-z0-9]+)/([A-Za-z0-9]+)\/?$ index2.php?city=$1&custom=$2 [L]
RewriteRule ^find-cheap-hotels-country/([A-Za-z0-9]+)\/?$ index2.php?country=$1 [L]
RewriteRule ^find-cheap-hotels-city/([A-Za-z0-9]+)\/?$ index2.php?city=$1 [L]
RewriteCond %{HTTP_HOST} ^(.*)\.hotels.sample.com$ [NC]
RewriteCond %1 !^(www)\.hotels.sample.$ [NC]
RewriteRule ^([^/]+)/?$ /home/sample/public_html/index.php [L]
물론 작동하지 않습니다. 누군가 나를 도울 수 있기를 바랍니다 !!
이 요구되는 사항에 대한 당신이 행복 정교한 작업이 완료 될 수 있을까요? 예제도 제공하십시오. Thnx – LazyOne
잘 somename.hotels.sample.com 예를 들어 hotels.sample.com에서 색인을 표시하는 데 필요한 .. 기본적으로 그런 .. –
그게 있다면 - 그럼 당신은 단순히 같은 폴더에 하위 도메인을 가리 키지 않는 이유는 무엇입니까? 메인 도메인으로? 당신이 다른 것을 원한다면, 더 잘 묘사하십시오. – LazyOne