2016-07-31 1 views
2

우리는 SilverStripe 루트 내에 커뮤니티이라는 폴더에로드 된 vBulletin 5 설치가 있습니다. 따라서 커뮤니티 색인 파일의 URL은 www.e-lumini.com/community이어야합니다.vbulletin forum 내 SilverStripe 루트 - URL 위임

그러나 URL에는 ./?url=/community (완전히 http://e-lumini.com/community/?으로 표시)이 자동으로 추가되며 물론 404 페이지로 리디렉션됩니다.

아마도 이것은 .htaccess 콘텐츠 문제입니다.

여기에 우리의 현재 SilverStripe이

### SILVERSTRIPE START ### 
# Deny access to templates (but allow from localhost) 
<Files *.ss> 
Order deny,allow 
Deny from all 
Allow from 127.0.0.1 
</Files> 

# Deny access to IIS configuration 
<Files web.config> 
Order deny,allow 
Deny from all 
</Files> 

# Deny access to YAML configuration files which might include sensitive  
information 
<Files *.yml> 
Order allow,deny 
Deny from all 
</Files> 

# Route errors to static pages automatically generated by SilverStripe 
ErrorDocument 404 /assets/error-404.html 
ErrorDocument 500 /assets/error-500.html 

<IfModule mod_rewrite.c> 
# Turn off index.php handling requests to the homepage fixes issue in apache =2.4 
<IfModule mod_dir.c> 
    DirectoryIndex disabled 
</IfModule> 

SetEnv HTTP_MOD_REWRITE On 
RewriteEngine On 
RewriteBase '/' 

# Deny access to potentially sensitive files and folders 
RewriteRule ^community - [L,NC] 
RewriteRule ^vendor(/|$) - [F,L,NC] 
RewriteRule silverstripe-cache(/|$) - [F,L,NC] 
RewriteRule composer\.(json|lock) - [F,L,NC] 

# Process through SilverStripe if no file with the requested name exists. 
# Pass through the original path as a query parameter, and retain the existing parameters. 
RewriteCond %{REQUEST_URI} ^(.*)$ 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteRule .* framework/main.php?url=%1 [QSA] 
</IfModule> 
### SILVERSTRIPE END ### 

참고 지금 (403) 오류가 발생합니다 단지 위의 지역 사회 재 작성 규칙의 포함을, 파일의 .htaccess입니다.

어떻게이 잘못된 URL 리디렉션 문제를 해결할 수 있습니까?

+0

:

우리는이 블록으로 커뮤니티 URL에 대한 모든 액세스를 다음과 같은 규칙을 제거해야합니다. – RamenChef

답변

1

우리는 main.phpRewriteRule이 URL이 SilverStripe의 프레임 워크 main.php 파일에 요청을 리디렉션하기 전에 /community로 시작하지 않는 것을 확인하기 위해 변경할 수 있습니다.

는 다음과 같이 우리의 .htaccess RewriteRule에 우리가 RewriteCond %{REQUEST_URI} !/community를 추가이를 확인하려면 다음

RewriteCond %{REQUEST_URI} ^(.*)$ 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_URI} !/community 
RewriteRule .* framework/main.php?url=%1 [QSA] 

이것은 community URL 및 하위 URL에 SilverStripe 리디렉션 액세스를 중지합니다. 이렇게하면이 디렉토리에 다른 응용 프로그램이나 코드를 넣을 수 있습니다. 난 당신이 코드를 게시하는 것을 잊었다 생각

RewriteRule ^community - [L,NC]