0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【未経験エンジニア2日目(復習①)】URLの.htmlの削除

Posted at

URLの.htmlの削除

やったこと

・URLの.htmlの削除

学んだこと

###hraccessの存在
###RewriteRule
 ディレクトリー内のURLを正規表現を用いて定義をすることができる
###RewriteCond
 RewriteRuleの条件を絞るこむために記載される(RewriteRuleの直前に記載される) 

実際のコード

.htaccess
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^(.*)$ $1.html

参考サイト

.phpや.htmlなどの拡張子をURL表示させない方法
.htaccess でのリダイレクト(転送)設定の書き方

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?