私は書き直しルールに強くはありません。私はすでに Wildcard .htaccess rewrite subdomian to a subdirectory with subdomain as GET variable(私の質問)と.htaccess rewrite: subdomain as GET parameter and filepath afterdomain intactとhttps://serverfault.com/questions/214512/を通過しましたが、私の問題の解決策を見つけることができませんでした。私は私の要求が可能かどうかもわかりませんが、私は依然として確かめることを依頼しています。私はこれが必要なのはなぜ
ワイルドカード.htaccessはGET変数としてサブドメインとホワイトリストドメインを書き換えます
http://example.com -> https://www.example.com [redirect]
http://example.com/dir/?key=12 -> https://www.example.com/dir/?key=12 [redirect]
https://example.com -> https://www.example.com [redirect]
https://example.com/dir/?key=12 -> https://www.example.com/dir/?key=12 [redirect]
http://xyz.example.com -> https://xyz.example.com [redirect]
http://www.xyz.example.com -> https://xyz.example.com [redirect]
https://www.xyz.example.com -> https://xyz.example.com [redirect]
https://xyz.example.com -> https://www.example.com/whitelabel/?user=xyz [proxy]
https://xyz.example.com/profile.php -> https://www.example.com/whitelabel/profile.php?user=xyz [proxy]
https://xyz.example.com/dir/settings.php -> https://www.example.com/whitelabel/dir/settings.php?user=xyz [proxy]
https://xyz.example.com/dir/settings.php?par=val -> https://www.example.com/whitelabel/dir/settings.php?user=xyz&par=val [proxy]
http://example.org -> https://www.example.com/whitelabel/?domain=abc.example.org [proxy]
https://www.example.org -> https://www.example.com/whitelabel/?domain=example.org [proxy]
https://example.org?param=val -> https://www.example.com/whitelabel/?domain=example.org¶m=val [proxy]
https://example.org/dir1/dir2?param=val -> https://www.example.com/whitelabel/dir1/dir2?domain=example.org¶m=val [proxy]
:
結果を希望しますか?登録されたすべてのユーザーは、デフォルトでサブドメインを取得しますが、ドメインを持っている場合は、そのドメインを専用のIPにポイントできます。私は各サブドメインまたはドメインに異なる内容を表示する必要があります。
私はすでにhttp-> httpsを行い、必要な場所にwwwを追加しました。私はGETパラメータとしてサブドメインも渡しました。それぞれのコードは個別にうまく動作しますが、組み合わせると機能しません。たぶん、それはルールの順序と関係があります。とにかく、私の.htaccessです
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^[^.]+\.[^.]+$
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [L,R=301]
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
RewriteCond %{HTTP_HOST} ^((?!www\.)[^.]+)\.toours\.com$
RewriteRule^https://www.toours.com/whitelabel%{REQUEST_URI}?user=%1 [QSA,L,P]
RewriteRule (.*)/whitelabel/(.*) $1/$2 [L]
</IfModule>
これはちょっとした内部エラーです。これはあなたの道のほとんどを取得する必要があります
'RewriteRule(。*)/ whitelabel /(.*)$ 1/$ 2 [L]'行をコメントして再テストします。 – anubhava
はまだ同じエラーです。 @anubhavaに参加してくれてありがとう。私はあなたのために連絡することを考えていた。あなたの評判はあなたの前にあります。 –
ありがとうございます。この時点でApache error.logをチェックして、なぜ500が来るのかを確認する必要があります。 – anubhava