#rewrite 3개의 스레드 ✕ 해제
이온디
이온디 7년 전
# block direct access to templates, XML schemas, config files, dotfiles, environment info, etc. location ~ ^/modules/editor/(skins|styles)/.+\.html$ { # pass } location ~ ^/(admin/help|common/manual)/.+\.html$ { # pass } location ~ ^/(addons|common/tpl|files/ruleset|(m\.)?l… # block direct access to templates, XML schemas, config files, dotfiles, environment info, etc. location ~ ^/modules/editor/(skins|styles)/.+\.html$ { # pass } location ~ ^/(admin/help|common/manual)/.+\.html$ { # pass } location ~ ^/(addons|common/tpl|files/ruleset|(m\.)?layouts|modules|plugins|themes|widgets|widgetstyles)/.+\.(html|xml)$ { return 403; } location ~ ^/messageTalk/talk.+\.php$ { # try_files $uri $uri/; fastcgi_pass unix:/run/php/pool.eond.sock; include snippets/fastcgi-php.conf; limit_req zone=antiddos burst=12 nodelay; } location ~ ^/misc/.+\.php$ { # try_files $uri $uri/; fastcgi_pass unix:/run/php/pool.eond.sock; include snippets/fastcgi-php.conf; limit_req zone=antiddos burst=12 nodelay; } location ~ ^/files/(attach|config|cache/store)/.+\.php$ { return 403; } location ~ ^/files/(env|member_extra_info/(new_message_flags|point))/ { return 403; } location ~ ^/(\.(git|ht|jshint)|codeception\.|composer\.|Gruntfile\.js|package\.json|CONTRIBUTING|COPYRIGHT|LICENSE|README) { return 403; } # fix incorrect relative URLs (for legacy support) location ~ ^/(.+)/(addons|common|files|layouts|m\.layouts|modules|widgets|widgetstyles)/(.+) { try_files $uri $uri/ /$2/$3; } # fix incorrect minified URLs (for legacy support) location ~ ^/(.+)\.min\.(css|js)$ { try_files $uri $uri/ /$1.$2; } # rss, blogAPI rewrite ^/(rss|atom)$ /index.php?module=rss&act=$1 last; rewrite ^/([a-zA-Z0-9_]+)/(rss|atom|api)$ /index.php?mid=$1&act=$2 last; rewrite ^/([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/(rss|atom|api)$ /index.php?vid=$1&mid=$2&act=$3 last; # trackback rewrite ^/([0-9]+)/(.+)/trackback$ /index.php?document_srl=$1&key=$2&act=trackback last; rewrite ^/([a-zA-Z0-9_]+)/([0-9]+)/(.+)/trackback$ /index.php?vid=$1&document_srl=$2&key=$3&act=trackback last; # administrator page rewrite ^/admin/?$ /index.php?module=admin last; # document category rewrite ^/([a-zA-Z0-9_]+)/category/([0-9]+)$ /index.php?mid=$1&category=$2 last; # document permanent link rewrite ^/([0-9]+)$ /index.php?document_srl=$1 last; # mid link #rewrite ^/([a-zA-Z0-9_]+)/?$ /index.php?mid=$1 last; location ~ ^/([a-zA-Z0-9_]+)/?$ { try_files $uri $uri/ /index.php?mid=$1; } # mid + document link rewrite ^/([a-zA-Z0-9_]+)/([0-9]+)$ /index.php?mid=$1&document_srl=$2 last; # vid + mid link rewrite ^/([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/?$ /index.php?vid=$1&mid=$2 last; # vid + mid + document link rewrite ^/([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/([0-9]+)$ /index.php?vid=$1&mid=$2&document_srl=$3 last; # mid + entry title rewrite ^/([a-zA-Z0-9_]+)/entry/(.+)$ /index.php?mid=$1&entry=$2 last; # vid + mid + entry title rewrite ^/([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/entry/(.+)$ /index.php?vid=$1&mid=$2&entry=$3 last;
이온디
이온디 8년 전
Nginx 서버에서 서브디렉토리(subdirectory)에서 index 파일을 못 가져오는 경우 [1] project.eond.com/ [2] project.eond.com/shu [3] project.eond.com/shu/index.html 실제 index.html 파일이 있는데도, [2]로 접속했을 때 404 오류를 뿜더군요. nginx 설정파일을 몇십번이나 수정하고 재시작해도 안되길래, 마지막 xe 설정 파일 부분을 빼니 잘 되네요 ㅠㅠ location / { … Nginx 서버에서 서브디렉토리(subdirectory)에서 index 파일을 못 가져오는 경우 [1] project.eond.com/ [2] project.eond.com/shu [3] project.eond.com/shu/index.html 실제 index.html 파일이 있는데도, [2]로 접속했을 때 404 오류를 뿜더군요. nginx 설정파일을 몇십번이나 수정하고 재시작해도 안되길래, 마지막 xe 설정 파일 부분을 빼니 잘 되네요 ㅠㅠ location / { root /home/project/www; index index.php index.html; } location /shu { alias /home/project/www/shu; index index.html; } xe_config 파일에 보면 mid link 라는 부분에 이렇게 수정했습니다. # mid link rewrite ^/shu/ /shu/index.html last; rewrite ^/xe/?$ /xe/index.php?mid=$1 last; rewrite ^/([a-zA-Z0-9_]+)/?$ /index.php?mid=$1 last; #rewrite ^/xe/([a-zA-Z0-9_]+)/?$ /index.php?mid=$1 last;
이온디
이온디 17년 전
<Files ~ "^.(htaccess|htpasswd)$"> deny from all </Files> RewriteEngine On RewriteCond %{HTTP_HOST} ^(www.eond.com)(:80)? [NC] RewriteRule ^(.*) http://eond.com/$1 [R=301,L] order deny,allow .htaccess 파일에 RewriteEngine On에서 위와 같이 수정하면 됩니다. 이전에는 index 파일에서 $host_name = $H… <Files ~ "^.(htaccess|htpasswd)$"> deny from all </Files> RewriteEngine On RewriteCond %{HTTP_HOST} ^(www.eond.com)(:80)? [NC] RewriteRule ^(.*) http://eond.com/$1 [R=301,L] order deny,allow .htaccess 파일에 RewriteEngine On에서 위와 같이 수정하면 됩니다. 이전에는 index 파일에서 $host_name = $HTTP_HOST; if($host_name == "www.eond.com") header("Location:http://eond.com"); 이렇게 추가했었는데 XE의 인덱스 파일에서는 제대로 먹히질 않더군요. 그래서 .htaccess 파일을 수정해주었습니다. 현재 이온디의 .htaccess 파일은 다음과 같습니다. RewriteEngine On RewriteCond %{HTTP_HOST} ^(www.eond.com)(:80)? [NC] RewriteRule ^(.*) http://eond.com/$1 [R=301,L] order deny,allow RewriteBase / RewriteCond $1 !^(is)/ RewriteCond %{HTTP_HOST} ^is\.eond\.com [NC] RewriteRule ^(.*)$ /is/$1 [L] RewriteCond %{HTTP_HOST} ^(mynote.eond.com)(:80)? [NC] RewriteRule ^(.*) http://me.eond.com/$1 [R=301,L] order deny,allow #RewriteCond $1 !^(mynote)/ #RewriteCond %{HTTP_HOST} ^mynote\.eond\.com [NC] #RewriteRule ^(.mynote)?$ ./index.php?mid=mynote [L] RewriteCond $1 !^(me)/ RewriteCond %{HTTP_HOST} ^me\.eond\.com [NC] RewriteRule ^(.me)?$ ./index.php?mid=mynote [L] #RewriteRule ^(.*)$ http://eond.com/mynote/$1 [L]