2017-12-25 22 views
0

공유 웹 사이트에서 2 개의 웹 사이트를 호스팅하고 있습니다. /public_html/에서
나는 example.com를 개최하고 /public_html/example2/에 나는 호스팅 한 example.com의 example2.com하위 폴더에 두 번째 WordPress 인스턴스 설치 문제

.htaccess

example2.com의
RewriteEngine On 
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://www.example.com/$1 [R,L] 

# BEGIN WordPress 
<IfModule mod_rewrite.c> 
RewriteEngine On 
RewriteBase/
RewriteRule ^index\.php$ - [L] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule . /index.php [L] 
</IfModule> 
# END WordPress 

#Custom Error Pages 
ErrorDocument 403 https://www.example.com/error-403/ 

.htaccess

# BEGIN WordPress 
<IfModule mod_rewrite.c> 
RewriteEngine On 
RewriteBase/
RewriteRule ^index\.php$ - [L] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule . /index.php [L] 
</IfModule> 
# END WordPress 

#Custom Error Pages 
ErrorDocument 403 http://www.example2.com/error-403/ 

내가 WA NT 하위 그것을 http://www.example2.com/ (SSL을하지 않는

  • example2.com (은 주 디렉토리에서의 SSL있다) https://www.example.com/

    • example.com 즉 WWW 버전과 별도로 웹 사이트 모두에 액세스 할 수 디렉토리)

    는 참고 : 나는 워드 프레스 일반 설정에서 설정 site_urlhome_url 주어진 URL 위에 있습니다. 내가 그래서 this answer을 읽은 후 https://www.example.com/example2/

    에 저를 취하고있다 example2.com에 액세스 할 때 내가 직면하고있어

    문제

    이고, 나는

    # BEGIN WordPress 
    <IfModule mod_rewrite.c> 
    RewriteEngine On 
    RewriteBase/
    
    RewriteRule ^index\.php$ - [L] 
    
    # if a directory or a file exists, use it directly 
    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteCond %{REQUEST_FILENAME} !-d 
    
    # if request is not for the /example2/ 
    RewriteCond %{REQUEST_URI} !^/example2/ [NC] 
    
    # otherwise forward it to index.php 
    RewriteRule . /index.php [L] 
    
    RewriteCond %{SERVER_PORT} 80 
    RewriteRule ^(.*)$ https://www.example.com/$1 [R,L] 
    </IfModule> 
    # END WordPress 
    
    example.com.htaccess 변경

    이제 example2.com에 액세스 할 수 있지만 퍼머 링크는 그렇지 않습니다. 그래서 그것을 재설정하려고 할 때 내 example2 .haccess 파일의 내용을 삭제하고 https://www.example.com/example2/으로 리디렉션 중입니다.

    아무도 나를 도와 줄 수 있습니까?

    나는 또한 행운을 가지고 이것을 시도했다 Configuring WordPress .htaccess to view subfolders.

  • 답변

    0

    나는 예 2 그 htaccess로는 다음과 같이해야한다고 생각 : 응답에 대한

    # BEGIN WordPress 
    <IfModule mod_rewrite.c> 
    RewriteEngine On 
    RewriteBase /example2 
    RewriteRule ^index\.php$ - [L] 
    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteRule . /index.php [L] 
    </IfModule> 
    # END WordPress 
    
    #Custom Error Pages 
    ErrorDocument 403 http://www.example2.com/error-403/ 
    
    +0

    감사합니다,하지만 사촌이 지금은 https://www.example.com'로 리디렉션되고, 작동하지 않는 것 같다/example2 /'. –