Fogeaters, Light The World.

04

2017-Aug

[web] 제로보드처럼 url 줄이기

작성자: title: MoonBlonix IP ADRESS: *.64.228.3 조회 수: 1654

http://www.phpschool.com/gnuboard4/bbs/board.php?bo_table=qna_function&wr_id=212209

http://search.naver.com/search.naver?where=nexearch&sm=ies_hty&ie=utf8&query=htaccess%20RewriteRule

http://leos.tistory.com/entry/htaccess-RewriteRule-1

http://www.busari.net/405

http://kurapa.com/content-a2132

http://pat.bingsan.net/461

http://www.superuser.co.kr/apache/rewrite_Module/Apache_rewrite_Module.htm


아파치 Rewrite 모듈이 필요하다.


제로보드 .htaccess
RewriteEngine On

# reserve XE Layout Template Source File (*.html)
RewriteRule ^layouts/(.+)/(.+)\.html$ ./index.php [L]

# static files
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^(.+)/files/(member_extra_info|attach|cache|faceOff)/(.*) ./files/$2/$3 [L]
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^([a-zA-Z0-9_]+)(/[a-zA-Z0-9_]+(/entry)?)?/(files|modules|common|widgets|widgetStyle|layouts|addons)/(.*) ./$4/$5 [L]

# rss , blogAPI
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?vid=$1&mid=$2&act=$3 [L]

# trackback
RewriteRule ^([0-9]+)/(.+)/trackback$ ./index.php?document_srl=$1&key=$2&act=trackback [L]
RewriteRule ^([a-zA-Z0-9_]+)/([0-9]+)/(.+)/trackback$ ./index.php?vid=$1&document_srl=$2&key=$3&act=trackback [L]

# administrator page
RewriteRule ^admin/?$ ./index.php?module=admin [L]

# document permanent link
RewriteRule ^([0-9]+)$ ./index.php?document_srl=$1 [L]

# mid link
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^([a-zA-Z0-9_]+)/?$ ./index.php?mid=$1 [L]
# mid + document link
RewriteRule ^([a-zA-Z0-9_]+)/([0-9]+)$ ./index.php?mid=$1&document_srl=$2 [L]

# vid + mid link
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/?$ ./index.php?vid=$1&mid=$2 [L]
# vid + mid + document link
RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/([0-9]+)$ ./index.php?vid=$1&mid=$2&document_srl=$3 [L]

# mid + entry title
RewriteRule ^([a-zA-Z0-9_]+)/entry/(.+)$ ./index.php?mid=$1&entry=$2 [L]
# vid + mid + entry title
RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/entry/(.+)$ ./index.php?vid=$1&mid=$2&entry=$3 [L]



출처: http://buybit.tistory.com/entry/
profile
profile

title: MoonBlonix

2018.04.15 14:44
*.229.88.152

nginx 의 경우:: http://jasontody.tistory.com/52


서버 콘픽 안에 아래 구문 추가

include /etc/nginx/sites-available/xe.conf;

List of Articles
번호 제목 글쓴이 날짜 조회 수
공지 [Web] 클라우드 IDE + 2 title: MoonBlonix 2017-06-25 15126
» [web] 제로보드처럼 url 줄이기 + 1 title: MoonBlonix 2017-08-04 1654
90 [php] 환경변수 $_SERVER title: MoonBlonix 2017-08-04 1686
89 [mysql] 테이블 수정 title: MoonBlonix 2017-08-04 1612
88 [Javascript] 섬세한 뒤로가기 구현 title: MoonBlonix 2017-08-01 1496
87 [php] 쿠키 사용하기 title: MoonBlonix 2017-08-01 1741
86 [javascript] POST 전송하기 title: MoonBlonix 2017-07-31 1605
85 [Web]다국적 웹사이트 제작 title: MoonBlonix 2017-07-27 1925
84 [php] 5 -> 7 변경점 정리 title: MoonBlonix 2017-07-23 1342
83 [php/mysqli] 설치 및 연동 + 2 title: MoonBlonix 2017-07-23 1691
82 [MySQL] 설치 및 기초명령어 title: MoonBlonix 2017-07-19 1006
81 [Web] JQuery 설치 title: MoonBlonix 2017-07-04 1672
80 [CSS] Toggle Switch Examples title: MoonBlonix 2017-07-01 1831
79 [CSS] Input Text Styles title: MoonBlonix 2017-07-01 1691
78 [Web] CSS 프론트엔드 워크프레임 소개 title: MoonBlonix 2017-06-25 1442
77 [C++] 코딩시 좋은 습관들 : 스타일 title: MoonBlonix 2017-06-11 1574
76 [PHP] 강좌 모음 + 1 title: MoonBlonix 2017-06-08 1907
75 [Arduino] 아두이노로 GPS(위치) 추적기(GPS Tracker)를 만들어 보았다 + 1 2N 2017-03-06 1423
74 [AI]딥러닝 공부 가이드 (SW 준비편) title: MoonBlonix 2017-01-15 1500
73 [C++ STL] std::vector + 2 title: MoonBlonix 2016-12-14 1737