0
http://example.com/index.php?path=controller/function
을 http://example.com/controller/function
으로 마스킹하고 싶습니다. function
이 반드시 필요하지는 않습니다.URL 경로를 매개 변수로 다시 변환
htaccess 파일로 어떻게 할 수 있습니까?
다음은 작동하지 않습니다. 내가 브라우저에서 http://example.com/controller/function
을 입력하면
RewriteRule ^/?assets/(.*)$ assets/$1 [L] # directory for CSS, images, and JavaScript
RewriteRule ^$ /index [redirect]
RewriteRule ^([a-zA-Z]+)/?([a-zA-Z/]*)$ index.php?path=$1/$2 [L]
현재, 나는 404 오류,하지만
http://example.com/index.php?path=controller/function
작품 입력을받을 수 있습니다.
감사합니다.
효과가 있습니다. 고맙습니다. –
'http : // example.com/uploads/var1/var2/file.txt'를'http : //example.com/index.php? filepath = var1/var2/file.txt'로 다시 작성해야한다면 어떻게해야합니까? ? –