2010-06-16 1 views
1

I가 내 공유 호스팅 서버에서 다음 foloder 트리 :아파치를 만드 브라우저의 주소 표시 줄에 또 다른 index.html을을 보여

이제 누군가가 인덱스 www.somesite.com 웹 서버 모양을 찾습니다 때
www.somesite.com 
| 
|_ public_html (document folder) 
    |_ .htaccess (Apache file) 
    |_ index.html (page shown by server now when someone looks for www.somesite.com) 
    | 
    |_ site_editor (folder) 
    | |_login.html (site editor control panel) 
    | |_file1.php 
    | |_file2.php 
    | |_ ... 
    | 
    |_ website (folder) 
     |_ index.html (website HOME PAGE) 
     |_ page1.html 
     |_ page2.html 
     |_ etc. 

.html은 public_html 폴더에 있습니다.

  1. 누군가가 내가 보여 자신의 브라우저 줄을 싶습니다 www.somesite.comwww.somesite.com/index.html하지 www.somesite.com/website/index.html

  2. 나는 것을 찾습니다 때 나는 website/index.html를 표시하는 웹 서버를 싶습니다 또한 웹 서버를 좋아하는 사람 표시 site_editor/login.html 누군가를 찾을 때 www.somesite.com/site_editor/

몇 가지 방법으로 .htaccess 파일을 설정하여 두 작업을 모두 수행 할 수 있습니까 ???

감사! 난 정말 그것을 테스트하지 않았더라도

답변

0

나는 다음 일을해야 제대로 이해하는 경우 :

RewriteEngine On 
RewriteBase/
# Rewrite everything that's not site_editor or already rewritten 
# to the website folder 
RewriteRule !^site_editor(/.*)?$ -   [C] 
RewriteRule !^website(/.*)?$  -   [C] 
RewriteRule ^(.*)$    website/$1 [PT,QSA,L] 
# Rewrite a request to site_editor/ to site_editor/login.html 
RewriteRule ^site_editor/$  site_editor/login.html 

사람들은 여전히 ​​그들이 원한다면 www.somesite.com/website/index.html에 갈 수 그래도. 나는 그 문제를 해결할 수있을 것이라고 생각하지만, .htaccess RewriteRules가 적용되는 까닭에 옳다는 것은 까다 롭습니다. 그것이 무엇인지 기억한다면 나는 나의 대답을 업데이트 할 것이다.