【发布时间】:2013-03-04 13:23:09
【问题描述】:
我目前正在使用 mod_rewrite 从文件中删除 .HTML 扩展名,并重定向到其友好版本。
我使用 pinterest.html 和 google.html 文件来验证我的 Pinterest 页面和 Google Apps 帐户。
对于 mod_rewrite,我使用的是这个:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.+)$ $1.html [L,QSA]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*\.html\ HTTP/
RewriteRule ^(.*)\.html$ /$1 [R=301,L]
我的问题是关于验证文件的逻辑和功能。据我了解,目的是为'x' file 和'y' URL 服务。
因此,即使由于重定向和 .HTML 删除,我将 example.com/pinterest.html 服务为 example.com/pinterest,也不应该有任何干扰,因为文件仍然像往常一样可读,对吗?
【问题讨论】:
标签: html url mod-rewrite google-apps pinterest