gblog - .htaccess를 썼을 때 경로문제

Clipboard01.gif
제가 수정한 globg를 .htaccess가 없는 상황에서 쓰면 아무 문제가 없는데
.htaccess를 넣고 사용을 하려니까, 경로의 문제가 나왔어요. ㅠ..ㅠ...

http://opencode.co.kr/blog/echo4me 와 같이 하면

$gb4[path] = "../blog"; 와 같이 들어 있는 값이,
http://opencode.co.kr/blog/../blog 이렇게 인식이 안되고
http://opencode.co.kr/blog/echo4me/../blog 이렇게 인식이 됩니다.

어떻게 해야 할까요???

-----------------------

<IfModule mod_rewrite.c>
RewriteEngine On

RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^([a-zA-Z0-9_]+)$ index\.php\?mb_id=$1
RewriteRule ^([a-zA-Z0-9_]+)/([0-9]+)$ index\.php\?mb_id=$1&id=$2
RewriteRule ^([a-zA-Z0-9_]+)/([0-9]+)/([0-9]+)/([0-9]+)$ index\.php\?mb_id=$1&yyyy=$2&mm=$3&dd=$4
RewriteRule ^([a-zA-Z0-9_]+)/([0-9]+)/([0-9]+)$ index\.php\?mb_id=$1&yyyy=$2&mm=$3

RewriteRule ^([a-zA-Z0-9_]+)/tag/([^\/]*)$ index\.php\?mb_id=$1&tag=$2
RewriteRule ^([a-zA-Z0-9_]+)/category/([^\/]*)$ index\.php\?mb_id=$1&cate=$2
RewriteRule ^([a-zA-Z0-9_]+)/search/([^\/]*)$ index\.php\?mb_id=$1&search=$2
RewriteRule ^([a-zA-Z0-9_]+)/rss$ rss\.php\?mb_id=$1
RewriteRule ^([a-zA-Z0-9_]+)/tags$ tags\.php\?mb_id=$1
RewriteRule ^([a-zA-Z0-9_]+)/guestbook$ guestbook\.php\?mb_id=$1

RewriteRule ^([a-zA-Z0-9_]+)/page/([0-9]+)$ index\.php\?mb_id=$1&page=$2
RewriteRule ^([a-zA-Z0-9_]+)/tag/([^\/]*)/page/([0-9]+)$ index\.php\?mb_id=$1&tag=$2&page=$3
RewriteRule ^([a-zA-Z0-9_]+)/category/([^\/]*)/page/([0-9]+)$ index\.php\?mb_id=$1&cate=$2&page=$3
RewriteRule ^([a-zA-Z0-9_]+)/search/([^\/]*)/page/([0-9]+)$ index\.php\?mb_id=$1&search=$2&page=$3
RewriteRule ^([a-zA-Z0-9_]+)/guestbook/page/([0-9]+)$ guestbook\.php\?mb_id=$1&page=$2
RewriteRule ^([a-zA-Z0-9_]+)/([0-9]+)/page/([0-9]+)$ index\.php\?mb_id=$1&id=$2&page=$3
RewriteRule ^([a-zA-Z0-9_]+)/([0-9]+)/([0-9]+)/([0-9]+)/page/([0-9]+)$ index\.php\?mb_id=$1&yyyy=$2&mm=$3&dd=$4&page=$5
RewriteRule ^([a-zA-Z0-9_]+)/([0-9]+)/([0-9]+)/page/([0-9]+)$ index\.php\?mb_id=$1&yyyy=$2&mm=$3&page=$4

RewriteRule ^([a-zA-Z0-9_]+)/preview/(.+)$ index\.php\?mb_id=$1&preview=$2
</IfModule>

첨부파일

Clipboard01.gif (47.3 KB)
0회 2010-05-16 05:41
.htaccess (1.6 KB) 3회 2010-05-16 05:41
|

댓글 8개

config.php 에서 블로그 설정을 해 주면 해결이 되지 않나요 ?


모든이미지의 경로가 ../../blog/skin/blog/basic/img/icon_category.gif 이런 식이네요..

블로그 안 이미지 경로에서 <img src='<?=$g4[path]?>/.....> 를 썼는데도 이렇게 나오면 문제가 있지 않나요 ?


RewriteCond %{REQUEST_URI} !^/blog(/*)


아래를 참조하셔서 blog 디렉 경로를 설정한 후에 이미지 경로를 $g4['blog_img'] 로 출력하면은 될꺼도 같은데요..

엉뚱한 발상인지도 모르겠군요..

// 디렉토리
$g4['bbs'] = "bbs";
$g4['bbs_path'] = $g4['path'] . "/" . $g4['bbs'];
$g4['bbs_img'] = "img";
$g4['bbs_img_path'] = $g4['path'] . "/" . $g4['bbs'] . "/" . $g4['bbs_img'];

제 텍스트큐브 설정 아래 올려드립니다.

<IfModule mod_url.c>
CheckURL Off
</IfModule>
#SetEnv PRELOAD_CONFIG 1
RewriteEngine On
RewriteBase /
RewriteRule ^(thumbnail)/([0-9]+/.+)$ cache/$1/$2 [L]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(cache)+/+(.+[^/])\.(cache|xml|txt|log)$ - [NC,F,L]
RewriteCond %{REQUEST_FILENAME} -d
RewriteCond %{REQUEST_URI} !^/wordpress(/*)
RewriteCond %{REQUEST_URI} !^/flickr(/*)
RewriteCond %{REQUEST_URI} !^/tiltviewer(/*)
RewriteCond %{REQUEST_URI} !^/simpleviewer(/*)
RewriteCond %{REQUEST_URI} !^/photo(/*)
RewriteCond %{REQUEST_URI} !^/punbb(/*)
RewriteCond %{REQUEST_URI} !^/gallery(/*)
RewriteCond %{REQUEST_URI} !^/oz(/*)
RewriteRule ^(.+[^/])$ $1/ [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !^/wordpress(/*)
RewriteCond %{REQUEST_URI} !^/flickr(/*)
RewriteCond %{REQUEST_URI} !^/tiltviewer(/*)
RewriteCond %{REQUEST_URI} !^/simpleviewer(/*)
RewriteCond %{REQUEST_URI} !^/photo(/*)
RewriteCond %{REQUEST_URI} !^/punbb(/*)
RewriteCond %{REQUEST_URI} !^/gallery(/*)
RewriteCond %{REQUEST_URI} !^/oz(/*)
RewriteRule ^(.*)$ rewrite.php [L,QSA]
파일경로는 맞는데, 이미지 url 경로만 이상하게 바뀌어서요. ㅠ..ㅠ...
텍큐의 .htaccess는 1 depth만 되어 있네요.
헛 감사합니다. 왠 돈벼락을 ~~ ^^;
저라면은 이미지 경로를 다 뜯어고치겠네요.

상대 경로로 하지 않고 http부터 변수로 환경설정 파일에 넣고,

cdn 이나 다른 서버에서 불러오면 상당히 매력이 있을 것이라 봅니다. ㅎㅎ
이미지 경로를 다 뜯어 고치기는 좀...ㅠ..ㅠ...
결국은 상대경로인

$gb4[path] = "../blog"; 와 같이 들어 있는 값이, 문제인 것 같습니다.

$gb4[path] = "../..";
.htaccess의 경로의 깊이에 따라서, 이미지 경로가 어긋나게 되더라구요. ㅠ..ㅠ...
답은 절대경로로 모든 것을 표시해야 한다에요. ㅠ..ㅠ...
좀 귀챤은 편법을 써서 대충~ 해결 했습니다.
댓글을 작성하시려면 로그인이 필요합니다.

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
15년 전 조회 1,642
15년 전 조회 1,739
15년 전 조회 1,562
15년 전 조회 1,967
15년 전 조회 1,532
15년 전 조회 1,466
15년 전 조회 1,635
15년 전 조회 1,721
15년 전 조회 1,669
15년 전 조회 2,313
15년 전 조회 1,644
15년 전 조회 1,545
15년 전 조회 1,535
15년 전 조회 4,680
15년 전 조회 1,618
15년 전 조회 5,679
15년 전 조회 1,565
15년 전 조회 1,547
15년 전 조회 1,495
15년 전 조회 1,442