답변 3개 / 댓글 6개
채택된 답변
+20 포인트
RewriteRule ^([^/]+)/$ /v1/$1.html
처럼 rewiterule 이용하세요.
* 루트 디렉토리 .htaccess 파일 생성
Copy
RewriteEngine On
# Rule to remove .html extension
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.+)$ /$1.html [NC,L]
# Rule to remove .php extension
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.+)$ /$1.php [NC,L]
답변에 대한 댓글 2개
폴더 하나 만들고, 그 안에 index.php (또는, index.html) 파일명으로 하시면 됩니다. (다른 파일명은 안 됨.)
(예) 실제로는 https://homzzang.com/game/index.php 주소이나 https://homzzang.com/game 주소로 접속하면 연결되는 식이죠.
답변을 작성하려면 로그인이 필요합니다.