htaccess 리다이렉션(리디렉션?) 채택완료
htaccess 리다이렉션에 관해 질문입니다.
여기 저기 검색을 해 보니,
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.aaa\.com)
RewriteRule (.*) http://www.bbb.net/$1">http://www.bbb.net/$1 [L]
요런식으로 쓰라고 나와있는데,
뭐가 뭔지 하나도 모르겠네요...
제가 하고 싶은건
예를 들면,
http://www.nanati.me/testpage/">www.nanati.me/testpage/
로 시작하는 하위디렉토리를 전부
http://www.nanati.me/test/index.html">www.nanati.me/test/index.html#abc
페이지로 보내고 싶거든요...
/ 이 것과 \ 이것을 어떻게 바꿔야 하는지도 잘 모르겠어서
여러분들께 도움을 구합니다 ...
답변 2개
http://httpd.apache.org/docs/2.4/en/images/rewrite_backreferences.png" alt="Flow of RewriteRule and RewriteCond matching" rel="xe_gallery" style="margin: 0px; padding: 0px; border: 1px solid rgb(170, 170, 170); outline: 0px; vertical-align: middle; max-width: 100%; height: auto; text-shadow: rgba(0, 0, 0, 0.0980392) 0px 0px 1px; cursor: pointer; background: transparent;">
Figure 1: The back-reference flow through a rule.
In this example, a request for /test/1234 would be transformed into /admin.foo?page=test&id=1234&host=admin.example.com.
(그림 1: 룰을 통한 역 참조의 흐름. 이 예제에서는 /test/1234에 대한 리퀘스트가 /admin.foo?page=test&id=1234&host=admin.example.com.으로 변환된다.)
http://sysdocu.tistory.com/427">http://sysdocu.tistory.com/427
댓글을 작성하려면 로그인이 필요합니다.
https://httpd.apache.org/docs/2.4/rewrite/remapping.html">https://httpd.apache.org/docs/2.4/rewrite/remapping.html 에서
Canonical URLs
파트가 비슷할 것 같습니다.
문제는 #abc가 어떤식으로 들어 오는지에 대해서가 없네요..
http://www.nanati.me/testpage/abc">www.nanati.me/testpage/abc 가 입력되면 http://www.nanati.me/test/index.html#abc로">www.nanati.me/test/index.html#abc로 바뀌는 것을 찾아 봐야 될 것 같습니다.
냑의 나나티님이 질문을 했는데, 답변이 없다니, 크리스마스동안 열심히공부해서 답변드리겠습니다. ㅎㅎ
답변에 대한 댓글 1개
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인
일단 열심히 구글을 뒤지는 중입니다...
영 어렵네요 ㅎㅎ
제 분야가 아니어서ㅠ