Home 게시판 커뮤니티 Q&A XE에 이전 후 예전글 연결하는 법

6개 답변, 2 voices Last updated by Avatar of happisthappist 7 years, 9 months 전
  • Avatar of happisthappist
    Participant
    @happist
    #31791

    안녕하세요?

    XE를 사용하다 워드프레스로 이전해왔습니다.  이전해주는 툴이 없어서 인터넷 서칭에 서칭을 거듭해 DB를 옮기고 테마 적용 등 기본 작업은 진행했는데요.

    기존 XE에서 등록한 글을 이번 워드프레스에에서 만들어지 글 주소로 연결을 시키고 싶습니다.

    예전 XE 주소는 happist.com/index.php?document_srl=519930 같은 형식이고

    새로 워드프레스 고유주소는 %post_id%/%postname%/로 사용자 정의로 설정했습니다.    http://happist.com/519930/다시-담아보는-장미-_-에버랜드에서

     

    .htaccess에서 RewriteRule을 설정하면 될 것 같은데 작을 하지는 않네요

    혹시 이와 고나련해 조언해줄 분이 잇을까요?

     

    현재 setting한 .htaccess 는 아래와 같습니다.

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^/index.php?document_srl=([0-9]+)$ /index.php/%post_id%/
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

     

    사이트주소는 http://happist.com 입니다.

    부탁드립니다.

    Avatar of 워드크래커워드크래커
    Participant
    @wordcracker7
    #31792

    안녕하세요?

     

    이 경우 post title 때문에 기본 permalink로 redirection시키는 것이 최선일 것 같습니다.

    RedirectMatch 301 ^/index\.php\?document_srl=(\d+)$ /?p=$1

    위와 같이 하여 잘 작동하는지 확인해보시기 바랍니다.

    테스트를 안 해 보아서 위의 코드가 제대로 작동할지는 모르겠네요.

    Avatar of 워드크래커

    • 워드프레스 정보 제공 블로그: Visit
    • 워드프레스와 관련하여 문제 해결이 필요한 경우 문의해주세요.

    Avatar of happisthappist
    Participant
    @happist
    #31793

    답변감사드립니다.

    .htaccess 첫줄에 코드를 넣었는데 작동하지는 않네요..

    . 혹시 이 코드를 다른곳에 넣어야 하는지요?

    . PHP버젼이 영향이 있을까요? PHP7.0을 적용한 호스팅을 사용중입니다.

    .  http://happist.com/519930/  나   http://happist.com/?p=519930/ 으로 해도 뜨긴 합니다.   519930는 ID이고 XE에서도 같은 번호를 사용했어요

     

    관심가져주셔서 감사드리고 아래는 새로 적용했던 코드입니다.
    # BEGIN WordPress

    RedirectMatch 301 ^/index\.php\?document_srl=(\d+)$ /?p=$1

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?happist.com [NC]
    RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?naver.com [NC]
    RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?nate.com [NC]
    RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?daum.net [NC]
    RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?bing.com [NC]
    RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yahoo.com [NC]
    RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google.co.kr [NC]
    RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google.com [NC]
    RewriteRule \.(jpg|jpeg|png|gif)$ – [NC,F,L]
    </IfModule>

    # wp-config.php파일 보호
    <files wp-config.php>
    order allow,deny
    deny from all
    </files>
    # directory browsing
    Options All -Indexes

    # END WordPress

    Avatar of 워드크래커워드크래커
    Participant
    @wordcracker7
    #31794

    RedirectMatch 대신에 Redirect로 바꾸어 확인해보시겠어요?

    http://www.inmotionhosting.com/support/website/redirects/setting-up-a-301-permanent-redirect-via-htaccess

     

    Avatar of happisthappist
    Participant
    @happist
    #31795

    Redirect로 바꾸어도 반응이 없네요.

    시간을 지내 서치엔진에서 바꾸어주길 기다려야 하나봐요

    Avatar of 워드크래커워드크래커
    Participant
    @wordcracker7
    #31797

    안녕하세요?

    Simple 301 Redirects 플러그인을 설치하고 그림과 같이 설정해주면 제대로 리디렉션될 것입니다.

    redirect 301

    제 환경에서 테스트해보니 잘 작동합니다.

    Avatar of happisthappist
    Participant
    @happist
    #31798

    조금 늦게 봤네요.

     

    이 플로그인은 이전에도  테스트해봤는데요

    그 당시에도 반응이 없었고 알려주신 와일드카드를 적용해도 반응이 없습니다.

     

    XE에서 가져오면서 강제로 DB값을 바꾸어서 그런지setting 어디엔지 문제가 있는지 작동이 안됩니다.

    몸소 테스트까지 해주셨는데 모둘바를 모르겠습니다.  고맙습니다.

7 글 보임 - 1에서 7 까지 (총 7 중에서)
  • 답변은 로그인 후 가능합니다.