これは私の現在の設定です:
<VirtualHost *:443>
ServerName www.product.com
Redirect "/something" "https://www.anotherredirectwebsite.com.com/something-name-product"
RedirectPermanent / https://www.redirectsite.com/
Include includes/product-config.inc
# Enable SSL
Include ssl-conf/product_ssl.conf
</VirtualHost>
# Redirect non-www to wwww
<VirtualHost *:443>
ServerName product.com
RedirectPermanent / https://www.product.com/
Include ssl-conf/product_ssl.conf
</VirtualHost>
# Redirect non-www http to https
<VirtualHost *:80>
ServerName product.com
RedirectPermanent / https://www.product.com/
</VirtualHost>
# Redirect www http to https
<VirtualHost *:80>
ServerName www.product.com
Define proxy_host www.product.com
RedirectPermanent / https://www.product.com/
</VirtualHost>
product.comにアクセスする全員が特定のWebサイトにリダイレクトされるようにします。ただし、誰かがproduct.com/somethingにアクセスした場合、別のWebサイトにリダイレクトされるようにしたいと思います。
問題は、product.com/anysubdirectoryがリダイレクトされないが、元のサイトが表示されることです。また、これにより/ somethingもリダイレクトされなくなります。
回答 1 件
関連記事
- ApacheはサブディレクトリURLをクエリ文字列に内部的にリダイレクトします
- ApacheリバースプロキシでのGoogleOAuthリダイレクトURI
- Apacheリダイレクト保持URL
- Apache 24 ProxyPassMatch Redirect 301の問題
- Apache Red Hatでhttpをhttpsにリダイレクトする
- Apache AliasMatch変数リダイレクトループ
- ドキュメントのルートディレクトリへのApache仮想ホストのリダイレクト
- 完全なホスト名をリダイレクトに追加するApache HTTPD:パスのみが必要です
- htaccessを使用してすべてのサブドメインとサブディレクトリをインデックスページにリダイレクトする
関連した質問
- 410のURLパターンをリダイレクトする
- haproxy sslが失敗し続ける
- Apache proxy_http:error 502
- httpsはsslをセットアップした後でもコンテンツを提供しませんが、httpは提供します
- 2つの異なるポートからのApache Redirectサブドメイン
- httpからhttpsへのリダイレクトは、Apache2のページ更新後にのみ機能します
- 特定のURLがhtaccessで指定されている場合にリダイレクトする
- サブフォルダーへのURL書き換え(サブディレクトリへのルートリダイレクト)htaccess
- Apache httpd VirtualHostのデフォルトページを定義するにはどうすればよいですか?
- Apacheリバースプロキシマッチリクエスト
これを試して