任意の URL を「public_html」ディレクトリに転送し、「public_html」を非表示にするこの構成があります。
# Add trailing slash if path does not contain a period or end with a slash
RewriteCond %{REQUEST_URI} !(\.|/$)
RewriteRule (.*) http://www.kent.gd/$1/ [R=301,L]
#Rewrites http://www.yoursite.com/subdir to http://www.yoursite.com/
RewriteCond %{REQUEST_URI} !^/public_html/
RewriteRule ^(.*)$ public_html/$1 [L]
サブドメインをメイン ドメインのようにリダイレクトさせたくないサブドメインを追加しました。
私はこれを試しましたが、動作しません:
RewriteCond %{HTTP_HOST} ^([^.]+)\.kent\.gd$ [NC]
RewriteRule ^(.*?)\.kent.gd /$1 [L]