이 코드는 왜 이런 일이 일어나고 있는지 정말 당혹 스럽습니다. [R = 302, L]을 추가하면 내 링크가 완벽하게 작동하기를 바랍니다. 하지만 내가 그것을 추가하지 않으면 나는 단지 [L] 을 가지고있다. 그것은 오류 페이지로 간다. R과 R의 차이점은 브라우저의 주소 표시 줄이 업데이트되었는지 여부뿐입니다.페이지에 의도 한 페이지 대신 오류 페이지가 표시됩니다.
코드의 마지막 줄입니다. 난 당신이 강요하는 R=***
플래그를 전달하여
내가 사용자가 입력 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]
실제로 요청을 처리하는 /home/index.php 또는 /home/index.html 파일이 있습니까? –
/home/index.php가 중요하지 않아야합니다. 자동으로 색인 파일을 찾습니다. –