| 904 | | if (preg_match('@\(thumbnail\)/\(\[0\-9\]\+/\.\+\) cache/\$1/\$2@', $content) == 0) { |
| 905 | | if ($service['type'] == 'path') |
| 906 | | $insertLine = 'RewriteRule ^[[:alnum:]]+/+(thumbnail)/([0-9]+/.+) cache/$1/$2 [E=SURI:1,L]'.CRLF; |
| 907 | | else |
| 908 | | $insertLine = 'RewriteRule ^(thumbnail)/([0-9]+/.+) cache/$1/$2 [E=SURI:1,L]'.CRLF; |
| 909 | | $findStr = 'RewriteRule !^(blog|cache)/ - [L]'; |
| 910 | | echo '<li>.htaccess thumbnail rule - ', _text('수정'); |
| 911 | | if (strpos($content, $findStr) == false) |
| 912 | | echo ': <span style="color:#33CC33;">', _text('실패'), '</span></li>'; |
| 913 | | else { |
| 914 | | $pos = strpos($content, $findStr) + strlen($findStr); |
| 915 | | while (((bin2hex($content[$pos]) == '0d') || (bin2hex($content[$pos]) == '0a') || (bin2hex($content[$pos]) == '20')) && (strlen($content) > $pos)) $pos++; |
| 916 | | $content = substr($content, 0, $pos) . $insertLine . substr($content,$pos); |
| 917 | | $fp = fopen($filename, "w"); |
| 918 | | fwrite($fp, $content); |
| | 903 | if ((preg_match('@rewrite\.php@', $content) == 0 ) || (strpos($content,'[OR]') !== false)) { |
| | 904 | $fp = fopen($filename, "w"); |
| | 905 | echo '<li>', _textf('htaccess 규칙을 수정합니다.'), ': '; |
| | 906 | $content = |
| | 907 | "#<IfModule mod_url.c> |
| | 908 | #CheckURL Off |
| | 909 | #</IfModule> |
| | 910 | #SetEnv PRELOAD_CONFIG 1 |
| | 911 | RewriteEngine On |
| | 912 | RewriteBase ".$service['path']."/ |
| | 913 | RewriteCond %{REQUEST_FILENAME} !-f |
| | 914 | RewriteRule ^(.*)$ rewrite.php [L,QSA] |
| | 915 | "; |
| | 916 | $fp = fopen($filename, "w"); |
| | 917 | if(fwrite($fp, $content)) { |