Changeset 6652
- Timestamp:
- 09/11/08 22:10:50 (4 months ago)
- Location:
- trunk
- Files:
-
- 2 modified
-
rewrite.php (modified) (1 diff)
-
setup.php (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/rewrite.php
r6644 r6652 10 10 } 11 11 if (!empty($_SERVER['PRELOAD_CONFIG']) && file_exists('config.php')) require_once ROOT."/config.php"; 12 // IIS 7.0 and URL Rewrite Module CTP 13 if (isset($_SERVER['HTTP_X_ORIGINAL_URL'])) 14 $_SERVER['REQUEST_URI'] = @iconv('cp949', 'utf-8', $_SERVER['HTTP_X_ORIGINAL_URL']);15 // IIS 5.x/6.0 and Ionics ISAPI Rewrite Filter16 if (isset($_SERVER['HTTP_X_REWRITE_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'])) { 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 17 $_SERVER['REQUEST_URI'] = urldecode($_SERVER['HTTP_X_REWRITE_URL']); 18 } 18 19 /* Retrieve Access Parameter Information. */ 19 20 $accessInfo = array( -
trunk/setup.php
r6623 r6652 382 382 } 383 383 } 384 if (!empty($_POST['checked']) )384 if (!empty($_POST['checked']) && $_POST['checked'] == 'yes') 385 385 return true; 386 386 } … … 773 773 if ($step == 33) { 774 774 $error = 16; 775 if (checkIIS()) { 776 ?> 777 <h3><?php echo _t('IIS Rewrite Module');?></h3> 778 <ul style="color:red"> 779 <li><?php echo _t('현재 IIS에서의 설치는 실험적으로만 지원하고 있으며 별도의 Rewrite 모듈을 사용해야 합니다.').' '._t('만약 이 페이지를 보고 계시다면 Apache mod_rewrite와 호환되지 않는 모듈을 사용 중이거나 아예 모듈이 없는 경우입니다.'); ?></li> 780 <li><?php echo _t('텍스트큐브와 호환되는 IIS용 Rewrite 모듈을 설치하려면, 오픈스소 무료 모듈을 제공하고 있는 <a href="http://www.codeplex.com/IIRF" target="_blank">Ionics Isapi Rewrite Filter 홈페이지</a>를 방문하십시오.'); ?></li> 781 <li><?php echo _t('여기서 계속 진행하여 설치를 완료한 후, 생성된 <b>.htaccess</b> 파일의 내용을 위 모듈의 설정파일(<b>IsapiRewrite4.ini</b>)에 복사하시기 바랍니다.'); ?></li> 782 <input type="hidden" name="rewriteIIS" value="yes" /> 783 </ul> 784 <?php 785 $error = 0; 786 } else { 775 787 ?> 776 788 <h3><?php echo _t('Apache Rewrite Engine');?></h3> … … 802 814 </ul> 803 815 <?php 816 } 804 817 } 805 818 ?> … … 810 823 </div> 811 824 </div> 812 <input type="hidden" name="checked" value="<?php echo ($error ? '' : 'checked');?>" />825 <input type="hidden" name="checked" value="<?php echo ($error > 0 ? 'no' : 'yes');?>" /> 813 826 <?php 814 827 } … … 819 832 } 820 833 // mod_rewrite routine. 821 if(empty($_POST['disableRewrite']) ) {834 if(empty($_POST['disableRewrite']) && empty($_POST['rewriteIIS'])) { 822 835 $filename = $root . '/.htaccess'; 823 836 $fp = fopen($filename, 'w+'); … … 847 860 } 848 861 @unlink($filename); 862 } else if (!empty($_POST['rewriteIIS'])) { 863 $rewrite = -1; 849 864 } else { 850 865 $rewrite = 0; … … 867 882 <table class="inputs"> 868 883 <?php 869 if ($rewrite >= 1) {884 if ($rewrite != 0) { 870 885 ?> 871 886 <tr> … … 881 896 } 882 897 ?> 883 <label for="type2"><input type="radio" id="type2" name="type" value="path"<?php echo ( $rewrite == 1? ' checked="checked"' : '');?> onclick="show('typePath');" />898 <label for="type2"><input type="radio" id="type2" name="type" value="path"<?php echo (($rewrite == 1 || $rewrite == -1) ? ' checked="checked"' : '');?> onclick="show('typePath');" /> 884 899 <?php echo _t('하위 경로(Path)로 블로그 식별');?></label></td> 885 900 </tr> … … 1611 1626 $fp = fopen($filename, 'w+'); 1612 1627 1613 $htaccessContent = 1628 if (checkIIS()) { 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 } else { 1642 $htaccessContent = 1614 1643 "#<IfModule mod_url.c> 1615 1644 #CheckURL Off … … 1618 1647 RewriteEngine On 1619 1648 RewriteBase $path/ 1620 RewriteRule ^(thumbnail)/([0-9]+/.+)$ cache/$1/$2 [L]1621 1649 RewriteCond %{REQUEST_FILENAME} -f 1622 1650 RewriteRule ^(cache)+/+(.+[^/])\.(cache|xml|txt|log)$ - [NC,F,L] … … 1624 1652 RewriteRule ^(.+[^/])$ $1/ [L] 1625 1653 RewriteCond %{REQUEST_FILENAME} !-f 1654 RewriteRule ^(thumbnail)/([0-9]+/.+)$ cache/$1/$2 [L] 1626 1655 RewriteRule ^(.*)$ rewrite.php [L,QSA] 1627 1656 "; 1657 } 1628 1658 1629 1659 if ($fp) { … … 1660 1690 </ul> 1661 1691 <p> 1692 <?php if (checkIIS()) echo _t('<b>IIS Rewrtie Filter 설정</b>을 해주십시오.<br />'); ?> 1662 1693 <?php echo _t('텍스트큐브 관리 툴로 로그인 하신 후 필요사항을 수정해 주십시오.');?><br /> 1663 1694 <?php echo _t('텍스트큐브를 이용해 주셔서 감사합니다.');?> … … 1897 1928 return testMyself_socket($host,$path,$port); 1898 1929 } 1930 return false; 1931 } 1932 1933 function checkIIS() { 1934 if (strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS') !== FALSE) 1935 return true; 1899 1936 return false; 1900 1937 }
