mod_rewriteのルールに問題があります。htaccess mod_rewriteルール
http://localhost/index.php?page=admin -> http://localhost/admin
http://localhost/index.php?page=welcome -> http://localhost/welcome
それは動作しますが、私は唯一のページ(歓迎または管理者)は、可変であるため、一つのルールを書きたい:これは、URLのは、次の通り変更
RewriteRule ^admin ?page=admin [NC]
RewriteRule ^welcome ?page=welcome [NC]
:ここに私が持っているものです。
私はそれが動作しません試みた何を:
RewriteRule ([^/]+) ?page=$1 [NC]
を私が間違っているのか?
私は解決策を見つけた
のRewriteRule^$ https://% {HTTP_HOST}/...あなたに少し近づく必要があります] *)$ index.php?page = $ 1 [NC] –
そして、index.phpを追加するまでうまくいきませんでした。それがなければ、私はApacheから誤った設定エラーを受けていました。 –