Q&A

CMS/프레임워크 Rhymix 2.1
개발 언어 PHP 7.4
문제 페이지 주소 비공개 (검색로봇)

안녕하세요.

 

게시판 모듈에서 글보기에서 '수정'버튼을 누르면 403에러가 뜨는 오류가 나타나고 있습니다. 

그런데 특이한 점은

관리자로 로그인하면 403에러가 나고, 
관리자가 아닌 경우 에러가 나지 않습니다.

비회원이 쓴 글을 비회원이 수정하는 것은 에러가 나지 않고
비회원이 쓴 글을 관리자가 수정하려면 에러가 납니다.
 

혹시나 해서 htaccess도 아래 첨부합니다. 

 

---

# .htaccess for XpressEngine / Rhymix
# Apache Server Config

RewriteEngine On

# 1. Block direct access to template files
RewriteRule ^(layouts|m.layouts)/(.+)/(.+)\.html$ - [L,F]
RewriteRule /(skins|m.skins)/(.+)/(.+)\.html$ - [L,F]

# 2. Block direct access to XML configs
RewriteRule ^(modules|addons|widgets)/(.+)/(conf|queries|schemas)/(.+)\.xml$ ./index.php [L]

# 3. Static files handling (Routing fixes for static resources)
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^(.+)/files/(member_extra_info|attach|cache|faceOff)/(.*) ./files/$2/$3 [L]
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^(.+)/(layouts|m.layouts|modules|widgets|widgetstyles|layouts|m.layouts|addons)/(.*) ./$2/$3 [L]

# 4. RSS / Atom / API Routing
RewriteRule ^(rss|atom)$ ./index.php?module=rss&act=$1 [L]
RewriteRule ^([a-zA-Z0-9_]+)/(rss|atom|api)$ ./index.php?mid=$1&act=$2 [L]
RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/(rss|atom|api)$ ./index.php?mid=$1&document_srl=$2&act=$3 [L]

# 5. Trackback Routing
RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/trackback$ ./index.php?mid=$1&document_srl=$2&act=trackback [L]
RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/trackback$ ./index.php?mid=$1&entry=$2&document_srl=$3&act=trackback [L]

# 6. Main Routing Rules (Short URL Support)
# If the requested file or directory doesn't exist, route to index.php

# Document (mid/srl)
RewriteRule ^([a-zA-Z0-9_]+)/([0-9]+)$ ./index.php?mid=$1&document_srl=$2 [L]

# Mid only
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^([a-zA-Z0-9_]+)/?$ ./index.php?mid=$1 [L]

# Mid + Action (e.g. modify, write)
RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)$ ./index.php?mid=$1&act=$2 [L]

nalireco Lv. 1

댓글 4

  • 일단 붙여주신 .htaccess 내용은 라이믹스 2.1에 포함된 .htaccess가 아닙니다.

    저렇게 1부터 6까지 번호 붙여 정리한 파일은 XE에서도 라이믹스에서도 지난 10여년간 배포한 적이 없습니다.

    사용하시는 버전의 코어를 다시 다운받으신 후 .htaccess 파일만 압축을 풀어서 비교해 보세요.

     

    만약 .htaccess 파일 교체로 해결되지 않는다면

    님 사이트에 답변자가 관리자 아이디로 로그인해서 확인해 볼 수는 없는 일이니,

    403 에러가 나는 스크린샷이라도 올려 주시면 도움이 될 것 같습니다.

    만약 에러가 나는 상태와 그렇지 않은 상태의 주소가 다르다면 그것도요.

  • @기진곰

    https://errdoc.gabia.io/403.html

    위 링크로 연결됩니다.
    htaccess파일은 아래 내용으로 바꾸었습니다​​​​​​​
    ----
    RewriteEngine On

    # block direct access to templates, XML schema files, config files, dotfiles, environment, etc.
    RewriteCond %{REQUEST_URI} !/modules/editor/(skins|styles)/
    RewriteRule ^(addons|common/tpl|files/(faceOff|ruleset)|(m\.)?layouts|modules|plugins|themes|widgets|widgetstyles)/.+\.(html|xml|blade\.php)$ - [L,F]
    RewriteRule ^files/(attach|config|cache)/.+\.(ph(p|t|ar)?[0-9]?|p?html?|cgi|pl|exe|[aj]spx?|inc|bak)$ - [L,F]
    RewriteRule ^files/(env|member_extra_info/(new_message_flags|point))/ - [L,F]
    RewriteRule ^(\.git|\.ht|\.travis|codeception\.|composer\.|Gruntfile\.js|package\.json|CONTRIBUTING|COPYRIGHT|LICENSE|README) - [L,F]

    # static files
    RewriteCond %{SCRIPT_FILENAME} !-f
    RewriteRule ^(.+)/(addons|files|layouts|m\.layouts|modules|widgets|widgetstyles)/(.*) ./$2/$3 [L]
    RewriteCond %{SCRIPT_FILENAME} !-f
    RewriteRule ^(.+)\.min\.(css|js)$ ./$1.$2 [L]

    # all other short URLs
    RewriteCond %{SCRIPT_FILENAME} !-f
    RewriteCond %{SCRIPT_FILENAME} !-d
    RewriteRule . index.php [L]

  • @nalireco

    아... 가비아라면 실제로 에러난 상황을 기록하기가 쉽지 않겠군요.

    자기네가 디자인한 에러화면으로 모조리 포워딩시키는 변태짓을 시전하니... 쩝...

  • @기진곰

    일단 다 밀고 다시 한번 해보려고 합니다