0

1 つのドメインを除くすべてのサブドメインを親ドメインにリダイレクトする htaccess があります。

RewriteEngine On
RewriteCond %{HTTP_HOST} ^([^.]+)\.theonlytutorials\.com$ [NC]
RewriteCond %1 !^(blog|www)$ [NC]
RewriteRule ^(.*)$ http://theonlytutorials.com/$1 [L,R=301]

このコードは、以前のホスティングでは正常に機能していました。しかし、Godaddy では機能していないようです。

リダイレクトしていますが、正確なホスティング場所にリダイレクトしています。

私のURL構造の1つ:

www.theonlytutorials.com/video/58/4496/ChessBaseGmbH

代わりに、次の場所にリダイレクトしています。

www.theonlytutorials.com/others/tutorials/video/58/4496/ChessBaseGmbH

その他/チュートリアルは、私のホスティングで作成されたフォルダーです

4

1 に答える 1

0

Go Daddy (およびおそらく他のホスト) では、リダイレクト コードにサイト フォルダー名を含める必要があります。

RedirectMatch 301 ^/site-folder-name/video/58/4496/ChessBaseGmbH/$ http://the full URL here where you want the redirect point to

/blog/ フォルダー / サイトから別のサイトへのリンクをリダイレクトしたい場合

RedirectMatch 301 ^/blog/video/58/4496/ChessBaseGmbH/$ http://the full URL here where you want the redirect point to

このフォルダー /others/ にあるサイトからリダイレクトを行い、ルート ドメインにリダイレクトしたいとします。

RedirectMatch 301 ^/others/video/58/4496/ChessBaseGmbH/$ http://the full URL here to your root domain where you want the redirect to point to

そして、このフォルダー構造 /others/another-nested-folder/ がある場合、論理的にはおそらく同じことが当てはまります

RedirectMatch 301 ^/others/another-nested-folder/video/58/4496/ChessBaseGmbH/$ http://the full URL here to your root domain where you want the redirect to point to
于 2013-10-07T17:22:03.383 に答える