本文へスキップ

[RewriteRule] URL에서 .html 삭제하기

MintState 2015年1月14日 11:37 閲覧 12615

[RewriteRule] URL에서 .html 삭제하기

How to remove .html from URL

DirectoryIndex index.html
#AddType application/x-httpd-php .jio

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.+)$ $1.html [L,QSA]

#301 from example.com/page.html to example.com/page
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*\.html\ HTTP/
RewriteRule ^(.*)\.html$ /$1 [R=301,L]

출처 : http://stackoverflow.com/questions/5730092/how-to-remove-html-from-url

共有 X Facebook LINE QR コード

コメント 0 件

最初のコメントを書いてみましょう。