Changeset 6681
- Timestamp:
- 09/17/08 10:43:39 (4 months ago)
- Location:
- branches/1.7
- Files:
-
- 3 modified
-
doc/requirements.txt (modified) (1 diff)
-
rewrite.php (modified) (1 diff)
-
setup.php (modified) (17 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/1.7/doc/requirements.txt
r6630 r6681 29 29 2. For Microsoft Windows : 30 30 31 Currently supports IIS7 only : 32 * Windows Vista / Windows Server 2008 33 * IIS 7.0 or above 34 * with URL Rewrite module 31 * IIS 5.0 or above 32 * with ISAPI Rewrite Filter 35 33 * PHP 5.2 or above 36 34 * with iconv / gd module -
branches/1.7/rewrite.php
r6630 r6681 10 10 } 11 11 if (!empty($_SERVER['PRELOAD_CONFIG']) && file_exists('config.php')) require_once ROOT."/config.php"; 12 if (isset($_SERVER['HTTP_X_ORIGINAL_URL'])) 12 // IIS 7.0 and URL Rewrite Module CTP, but non-ASCII URLs are NOT supported. 13 if (isset($_SERVER['HTTP_X_ORIGINAL_URL'])) { 13 14 $_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_ORIGINAL_URL']; 15 } // IIS 5.x/6.0/7.0 and Ionics ISAPI Rewrite Filter 16 else if (isset($_SERVER['HTTP_X_REWRITE_URL'])) { 17 $_SERVER['REQUEST_URI'] = urldecode($_SERVER['HTTP_X_REWRITE_URL']); 18 } 14 19 /* Retrieve Access Parameter Information. */ 15 20 $accessInfo = array( -
branches/1.7/setup.php
r6630 r6681 30 30 $path = stripPath(substr($_SERVER['PHP_SELF'], 0, strlen($_SERVER['PHP_SELF']) - 12)); 31 31 } 32 33 define ('ROOT', $root); 32 $_SERVER['PHP_SELF'] = rtrim($_SERVER['PHP_SELF'], '/'); 33 34 if (!defined('ROOT')) 35 define ('ROOT', $root); 34 36 35 37 $__requireBasics = array( … … 382 384 } 383 385 } 384 if (!empty($_POST['checked']) )386 if (!empty($_POST['checked']) && $_POST['checked'] == 'yes') 385 387 return true; 386 388 } … … 767 769 if ($step == 33) { 768 770 $error = 16; 771 if (checkIIS()) { 772 ?> 773 <h3><?php echo _t('IIS Rewrite Module');?></h3> 774 <ul style="color:red"> 775 <li><?php echo _t('현재 IIS에서의 설치는 실험적으로만 지원하고 있으며 별도의 Rewrite 모듈을 사용해야 합니다.').' '._t('만약 이 페이지를 보고 계시다면 Apache mod_rewrite와 호환되지 않는 모듈을 사용 중이거나 아예 모듈이 없는 경우입니다.'); ?></li> 776 <li><?php echo _t('텍스트큐브와 호환되는 IIS용 Rewrite 모듈을 설치하려면, 오픈스소 무료 모듈을 제공하고 있는 <a href="http://www.codeplex.com/IIRF" target="_blank">Ionics Isapi Rewrite Filter 홈페이지</a>를 방문하십시오.'); ?></li> 777 <li><?php echo _t('여기서 계속 진행하여 설치를 완료한 후, 생성된 <b>.htaccess</b> 파일의 내용을 위 모듈의 설정파일(<b>IsapiRewrite4.ini</b>)에 복사하시기 바랍니다.'); ?></li> 778 <input type="hidden" name="rewriteIIS" value="yes" /> 779 </ul> 780 <?php 781 $error = 0; 782 } else { 769 783 ?> 770 784 <h3><?php echo _t('Apache Rewrite Engine');?></h3> … … 796 810 </ul> 797 811 <?php 812 } 798 813 } 799 814 ?> … … 804 819 </div> 805 820 </div> 806 <input type="hidden" name="checked" value="<?php echo ($error ? '' : 'checked');?>" />821 <input type="hidden" name="checked" value="<?php echo ($error > 0 ? 'no' : 'yes');?>" /> 807 822 <?php 808 823 } … … 813 828 } 814 829 // mod_rewrite routine. 815 if(empty($_POST['disableRewrite']) ) {830 if(empty($_POST['disableRewrite']) && empty($_POST['rewriteIIS'])) { 816 831 $filename = $root . '/.htaccess'; 817 832 $fp = fopen($filename, 'w+'); … … 841 856 } 842 857 @unlink($filename); 858 } else if (!empty($_POST['rewriteIIS'])) { 859 $rewrite = -1; 843 860 } else { 844 861 $rewrite = 0; … … 855 872 <input type="hidden" name="checked" value="<?php echo (isset($_POST['checked']) ? $_POST['checked'] : '');?>" /> 856 873 <input type="hidden" name="domain" value="<?php echo $domain;?>" /> 857 <input type="hidden" name="disableRewrite" value="<?php echo (isset($_POST['disableRewrite']) ? $_POST['disableRewrite'] : false);?>" /> 874 <input type="hidden" name="disableRewrite" value="<?php echo (isset($_POST['disableRewrite']) ? $_POST['disableRewrite'] : '');?>" /> 875 <input type="hidden" name="rewriteMode" value="<?php echo ($rewrite == -1) ? 'ISAPI' : 'mod_rewrite';?>" /> 858 876 <div id="inner"> 859 877 <h2><span class="step"><?php echo _f('%1단계', $step);?></span> : <?php echo _t('사용 가능한 운영 방법은 다음과 같습니다. 선택하여 주십시오.');?></h2> … … 861 879 <table class="inputs"> 862 880 <?php 863 if ($rewrite >= 1) {881 if ($rewrite != 0) { 864 882 ?> 865 883 <tr> … … 875 893 } 876 894 ?> 877 <label for="type2"><input type="radio" id="type2" name="type" value="path"<?php echo ( $rewrite == 1? ' checked="checked"' : '');?> onclick="show('typePath');" />895 <label for="type2"><input type="radio" id="type2" name="type" value="path"<?php echo (($rewrite == 1 || $rewrite == -1) ? ' checked="checked"' : '');?> onclick="show('typePath');" /> 878 896 <?php echo _t('하위 경로(Path)로 블로그 식별');?></label></td> 879 897 </tr> … … 949 967 <input type="hidden" name="checked" value="<?php echo (isset($_POST['checked']) ? $_POST['checked'] : '');?>" /> 950 968 <input type="hidden" name="domain" value="<?php echo (isset($_POST['domain']) ? $_POST['domain'] : '');?>" /> 951 <input type="hidden" name="disableRewrite" value="<?php echo (isset($_POST['disableRewrite']) ? $_POST['disableRewrite'] : false);?>" /> 969 <input type="hidden" name="disableRewrite" value="<?php echo (isset($_POST['disableRewrite']) ? $_POST['disableRewrite'] : '');?>" /> 970 <input type="hidden" name="rewriteMode" value="<?php echo (isset($_POST['rewriteMode']) ? $_POST['rewriteMode'] : '');?>" /> 952 971 <input type="hidden" name="type" value="<?php echo (isset($_POST['type']) ? $_POST['type'] : '');?>" /> 953 972 <div id="inner"> … … 1029 1048 <input type="hidden" name="domain" value="<?php echo (isset($_POST['domain']) ? $_POST['domain'] : '');?>" /> 1030 1049 <input type="hidden" name="disableRewrite" value="<?php echo (isset($_POST['disableRewrite']) ? $_POST['disableRewrite'] : false);?>" /> 1050 <input type="hidden" name="rewriteMode" value="<?php echo (isset($_POST['rewriteMode']) ? $_POST['rewriteMode'] : '');?>" /> 1031 1051 <input type="hidden" name="type" value="<?php echo (isset($_POST['type']) ? $_POST['type'] : '');?>" /> 1032 1052 <input type="hidden" name="blog" value="<?php echo (isset($_POST['blog']) ? $_POST['blog'] : '');?>" /> … … 1601 1621 @chmod($filename, 0666); 1602 1622 } 1603 if(!isset($_POST['disableRewrite']) || !$_POST['disableRewrite']) { 1623 if(!isset($_POST['disableRewrite']) || !$_POST['disableRewrite']) { 1604 1624 $filename = $root . '/.htaccess'; 1605 1625 $fp = fopen($filename, 'w+'); 1606 1626 1607 $htaccessContent = 1627 switch ($_POST['rewriteMode']) { 1628 case 'ISAPI': 1629 // Users must copy these rules to IsapiRewrite4.ini 1630 $htaccessContent = 1631 "RewriteCond %{REQUEST_FILENAME} -f 1632 RewriteRule ^$path/(cache)+/+(.+[^/])\.(cache|xml|txt|log)$ - [NC,F,L,U] 1633 RewriteCond %{REQUEST_FILENAME} -d 1634 RewriteRule ^$path/([^?]+[^/])$ $path/$1/ [L,U] 1635 RewriteCond %{REQUEST_FILENAME} !-f 1636 RewriteRule ^$path/(thumbnail)/([0-9]+/.+)$ $path/cache/$1/$2 [L,U] 1637 RewriteCond %{QUERY_STRING} ^$ 1638 RewriteRule ^$path/(.*)$ $path/rewrite.php [L,U] 1639 RewriteRule ^$path/(.*)$ $path/rewrite.php?%{QUERY_STRING} [L,U] 1640 "; 1641 break; 1642 case 'mod_rewrite': 1643 default: 1644 $htaccessContent = 1608 1645 "#<IfModule mod_url.c> 1609 1646 #CheckURL Off … … 1612 1649 RewriteEngine On 1613 1650 RewriteBase $path/ 1614 RewriteRule ^(thumbnail)/([0-9]+/.+)$ cache/$1/$2 [L]1615 1651 RewriteCond %{REQUEST_FILENAME} -f 1616 1652 RewriteRule ^(cache)+/+(.+[^/])\.(cache|xml|txt|log)$ - [NC,F,L] … … 1618 1654 RewriteRule ^(.+[^/])$ $1/ [L] 1619 1655 RewriteCond %{REQUEST_FILENAME} !-f 1656 RewriteRule ^(thumbnail)/([0-9]+/.+)$ cache/$1/$2 [L] 1620 1657 RewriteRule ^(.*)$ rewrite.php [L,QSA] 1621 1658 "; 1659 } 1622 1660 1623 1661 if ($fp) { … … 1654 1692 </ul> 1655 1693 <p> 1694 <?php if (checkIIS()) echo _t('새로 IIS용 Rewrite 모듈을 설치하셨다면 <b>ISAPI Rewrite Filter 설정</b>을 해주십시오.<br />'); ?> 1656 1695 <?php echo _t('텍스트큐브 관리 툴로 로그인 하신 후 필요사항을 수정해 주십시오.');?><br /> 1657 1696 <?php echo _t('텍스트큐브를 이용해 주셔서 감사합니다.');?> … … 1891 1930 return testMyself_socket($host,$path,$port); 1892 1931 } 1932 return false; 1933 } 1934 1935 function checkIIS() { 1936 if (strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS') !== FALSE) 1937 return true; 1893 1938 return false; 1894 1939 }
