0

このコードは、なぜこれが起こっているのかについて本当に困惑しています。[R=302,L] を追加すると、リンクは期待どおりに完全に機能します。しかし、追加せずに [L] しかない場合は、エラー ページに移動します。R と No R の違いは、ブラウザのアドレスバーが更新されるかどうかだけではないでしょうか。

これはコードの最後の行です。内部/サイレント mod_rewrite を実行しようとしています

ユーザーがhttp://example.comとhttp://example.com/home/のどちらを入力するか知りたい

内部で同じ URL が必要http://example.com/home

# Do not remove this line, otherwise mod_rewrite rules will stop working

RewriteBase /

AddHandler application/x-httpd-php .css

AddHandler application/x-httpd-php .js
Options +Multiviews

RewriteEngine On

#NC not case sensitive
#L last rule don't process futher
#R 301 changes the url to what you want


#changes the host to make sure it has no www infront
RewriteCond %{HTTP_HOST} !^example\.host56\.com 
RewriteRule ^(.*)$ http://example.host56.com [R=302,L]


#kills request with file extensions
RewriteCond %{THE_REQUEST} \.(php|jsp|html|jsp|asp)/?\ HTTP/
RewriteRule .* - [F]

#selects home
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /\ HTTP/1.1$
RewriteRule ^.*$ home/ [L]
4

1 に答える 1