【发布时间】:2019-07-27 09:31:36
【问题描述】:
我是怎么做到的:
www.example.com/services
将指向这个文件:
/services.html
但是这个:
www.example.com/services/pocket-pool
将指向这个目录:
/services/pocket-pool.html
我的 .htaccess 中有这些重写规则:
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^/?([^\.]+)$ $1.html [L]
ErrorDocument 404 /404.html
谢谢!
【问题讨论】:
标签: html .htaccess mod-rewrite url-rewriting