나는 html/php
응용 프로그램에서 로컬 서버에서 일하고 있어요 내가 성공htaccess로 URL 재 작성은 작동하고 있지만 재
응용 프로그램이 ./Compta/index.php
에 저장하지 않고 아파치 URL 재 작성 모듈을 사용하려고 해요. http://localhost/Compta/Test/
대신 : 나는 ./Compta/.htaccess
난 단지처럼 재 작성된 URL을 사용하고 싶습니다에 .htaccess
파일을 가지고 그들이 이전 URL로 이동하려고하면 http://localhost/Compta/index.php?page=test
및 사용자를 리디렉션
htaccess로 파일에는 다음이 포함
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^([[:alnum:]]*)/$ /Compta/index.php?page=$1 [L]
RewriteRule ^([[:alnum:]]*)$ /Compta/index.php?page=$1 [L]
RewriteCond %{REQUEST_URI} ^/index\.php$
RewriteCond %{QUERY_STRING} ^page=([[:alnum:]]*)$
RewriteRule ^(.*)$ http://localhost/Compta/%1/ [L,R=301]
나는 t을 갈 때 오 http://localhost/Compta/Test/
다음 줄이 작동하고 내 코드는 사업부에 test.php
의 내용이 포함
http://localhost/Compta/Test
로 이동하지만, 파이어 폭스에서 URL이
http://localhost/Compta/index.php?page=Test
에 다시 작성하고 이런 일이되지
RewriteRule ^([[:alnum:]]*)/$ /Compta/index.php?page=$1 [L]
http://localhost/Compta/Test2
; url은 다시 작성되지 않습니다.
RewriteRule ^([[:alnum:]]*)$ /Compta/index.php?page=$1 [L]
이 문제를 해결하기 위해 내가이 라인을 추가 이전 URL 리디렉션 :
RewriteCond %{REQUEST_URI} ^/index\.php$
RewriteCond %{QUERY_STRING} ^page=([[:alnum:]]*)$
RewriteRule ^(.*)$ http://localhost/Compta/%1/ [L,R=301]
하지만이 작동하지 않습니다 내가 http://localhost/Compta/index.php?page=Test
에 갈 때 URL이 http://localhost/Compta/Test/
미리 감사드립니다.