.htaccess 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. # CORS 설정
  2. Header always set Access-Control-Allow-Origin "*"
  3. Header always set Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS"
  4. Header always set Access-Control-Allow-Headers "Content-Type, Authorization, X-Requested-With, Origin, Accept"
  5. Header always set Access-Control-Max-Age "86400"
  6. # OPTIONS 요청에 대한 응답
  7. RewriteEngine On
  8. RewriteCond %{REQUEST_METHOD} OPTIONS
  9. RewriteRule ^(.*)$ $1 [R=200,L]
  10. # Board routing - FAQ
  11. RewriteRule ^board_list/faq$ backend/index.php?/board_list/faq [L,QSA]
  12. # Board routing - Media (News, Press)
  13. RewriteRule ^board_list/media$ backend/index.php?/board_list/media [L,QSA]
  14. # Board routing - Media SNS
  15. RewriteRule ^board_list/media_sns$ backend/index.php?/board_list/media_sns [L,QSA]
  16. # Board routing - Technology (Patents)
  17. RewriteRule ^board_list/technology1$ backend/index.php?/board_list/technology1 [L,QSA]
  18. RewriteRule ^board_list/technology2$ backend/index.php?/board_list/technology2 [L,QSA]
  19. RewriteRule ^board_list/technology3$ backend/index.php?/board_list/technology3 [L,QSA]
  20. RewriteRule ^board_list/technology4$ backend/index.php?/board_list/technology4 [L,QSA]
  21. # Backend upload 이미지 접근 허용
  22. RewriteRule ^backend/upload/(.*)$ backend/upload/$1 [L]
  23. # /api/ 경로는 CodeIgniter로 라우팅
  24. RewriteCond %{REQUEST_URI} ^/api/(.*)$
  25. RewriteRule ^api/(.*)$ /api/index.php/$1 [L,QSA]
  26. # /api/ 경로의 정적 파일들 (images, assets, upload 등)
  27. RewriteCond %{REQUEST_URI} ^/api/(images|asset|upload)/(.*)$
  28. RewriteRule ^api/(.*)$ /api/$1 [L]
  29. # 나머지는 Nuxt.js로 (실제 운영에서는 Nginx/Apache가 처리)
  30. # 개발 환경에서는 npm run dev가 처리함