実現したいこと
hogehoge.com
というドメインを持っているとして、
URLが
https://hogehoge.com/●●●
とアクセスされた場合、
https://hogehoge.com/view/index.html?user_name=●●●
にリライトしたいです。つまりパスをパラメータに変換してリクエストしたいということです。
ただし、
ユーザに見えるURLは「https://hogehoge.com/●●●」
のままを保ちたいです。
以下を試しましたが、500エラーになってしまい、表示がされません。
前提
エックスサーバを利用しています
試したこと
ドメイン直下に.htaccessを設置し、
htaccess
1RewriteEngine On 2RewriteRule ^admin$ /admin/index.html [L] 3RewriteRule ^(.+)$ /view/index.html?user_name=$1 [L]
としましたが、
例えば
https://hogehoge.com/test
とブラウザに打ち込むと500エラーとなります。
お使いのWebサーバのログには、どのようなメッセージが記録されているでしょうか。
エックスサーバーであれば、https://www.xserver.ne.jp/manual/man_server_logerror.php の手順で確認してください。
ご想像の通りだと思いますが、以下のリダイレクトループエラーでした。
AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
