0

私が構築している Web サイトに、ユーザーのアカウント ページ用のセクションがあります。

サイトのこのビットのマップは次のようになります。

*root*/account/details.php
*root*/account/subscriptions.php
*root*/account/options.php

ユーザーが次の場所に移動した場合に、次のようにします。

*root*/account

彼らはにリダイレクトされます

*root*/account/details.php

基本的な書き直しは次のようになります。

RewriteRule ^account/ account/details.php [L]

ただし、このルールは、すべてのページ (サブスクリプション、オプション) も詳細にリダイレクトされることを意味し、明らかに問題があります。

root /account のみを詳細ページにリダイレクトし、他のページは独立して動作するようにルールを編集するにはどうすればよい ですか?

4

1 に答える 1

1

From what I understand you want to rewrite only /account/, but not /account/XXXX. In this case try: RewriteRule ^account/$ account/details.php [L] In this case '$' identified the end of the pattern, so nothing after /account/ will be looked at.

于 2013-11-06T13:49:43.873 に答える