메뉴 건너뛰기

2016.12.22 19:00

mod_rewrite 예제

조회 수 7406 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^/([a-z0-9_-]+)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) /test/index.php [L]

이것은

http://domain.com/test

라는 아이디를
/test/test.php로 보내라는 의미 입니다.

받는 페이지에서는 즉 test.php

<?php
$a = $_SERVER['REQUEST_URI'];

하면 뒤에 따라 오는 test 라는 문자열을 찾을 수 있습니다.

이것을  사용하기 위해서는

http.conf

<VirtualHost>
  AllowOverride All
  Options FollowSymLinks

</VirtualHost>

위 설정이 추가 되어야 합니다.


  1. No Image

    DHCP IP 자동 할당

    Date2017.03.11 Views8268
    Read More
  2. No Image

    Tomcat 6에 Datasource 설정하기

    Date2017.03.11 Views7997
    Read More
  3. tomcat - server.xml 설정

    Date2017.03.11 Views143597
    Read More
  4. [CentOS 6.5] Virtual Box를 이용한 CentOS 6.5 설치

    Date2017.03.11 Views6920
    Read More
  5. [CentOS 6.5] SSH,TELNET, FTP 설치 및 운용

    Date2017.03.11 Views8943
    Read More
  6. [CentOS 6.5] JDK (JAVA) 설치

    Date2017.03.11 Views8965
    Read More
  7. [CentOS 6.5] Tomcat 설치 및 구동

    Date2017.03.11 Views9804
    Read More
  8. No Image

    TOMCAT/사이트 여러개 운영

    Date2017.03.09 Views8711
    Read More
  9. No Image

    SSH / FTP 등 기본 접속환경 설정(리눅스 / 솔라리스)

    Date2017.02.03 Views8118
    Read More
  10. No Image

    솔라리스 10 (Telnet/FTP/SSH) 설정

    Date2017.02.03 Views8343
    Read More
  11. 아파치 디렉토리 보이는 것 막기

    Date2017.02.02 Views8333
    Read More
  12. No Image

    아파치 로그(Apache Log) 관리법

    Date2017.02.02 Views8155
    Read More
  13. crontab 을 이용한 PHP 스케줄링 작업

    Date2017.02.02 Views8816
    Read More
  14. No Image

    crontab 설정 방법

    Date2017.02.02 Views7444
    Read More
  15. No Image

    apachec rewrite 사용하기 // www 강제 사용 // HTTP to HTTPS // 특정경로만 HTTP

    Date2016.12.30 Views7355
    Read More
  16. No Image

    APACHE, OHS 400 웹로직 연동후 특정 작업에 400 error

    Date2016.12.30 Views8978
    Read More
  17. No Image

    netstat 사용법

    Date2016.12.22 Views9147
    Read More
  18. No Image

    mod_rewrite 예제

    Date2016.12.22 Views7406
    Read More
  19. No Image

    아파치 웹로직 연동(Virtual Host)

    Date2016.11.22 Views8836
    Read More
  20. No Image

    Apache 2.2.17 + WebLogic 10.3.3 연동하기

    Date2016.11.22 Views9124
    Read More
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 12 Next
/ 12

하단 정보를 입력할 수 있습니다

© k2s0o1d4e0s2i1g5n. All Rights Reserved

Sketchbook5, 스케치북5

Sketchbook5, 스케치북5

나눔글꼴 설치 안내


이 PC에는 나눔글꼴이 설치되어 있지 않습니다.

이 사이트를 나눔글꼴로 보기 위해서는
나눔글꼴을 설치해야 합니다.

나눔고딕 사이트로 가기

Sketchbook5, 스케치북5

Sketchbook5, 스케치북5