.htaccess htaccess如何添加filenextention

.htaccess htaccess如何添加filenextention,.htaccess,mod-rewrite,.htaccess,Mod Rewrite,我见过梅·佩奇,她就要过来了 www.page.com/name 要得到这个,我必须改变.htaccess 但我不知道怎么做 给这个打电话:www.page.com/name.html (名称必须是变量名) 有人帮我吗? 非常感谢。通过httpd.conf启用mod_rewrite和.htaccess,然后将此代码放在文档根目录下的.htaccess中: Options +FollowSymLinks -MultiViews # Turn mod_rewrite on RewriteEngine

我见过梅·佩奇,她就要过来了

www.page.com/name

要得到这个,我必须改变.htaccess 但我不知道怎么做

给这个打电话:www.page.com/name.html (名称必须是变量名)

有人帮我吗?
非常感谢。

通过
httpd.conf
启用mod_rewrite和.htaccess,然后将此代码放在
文档根目录下的
.htaccess
中:

Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /

# To externally redirect /dir/foo.html to /dir/foo
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.html [NC]
RewriteRule ^ %1 [R=301,L]

## To internally forward /dir/foo to /dir/foo.html
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.*?)/?$ $1.html [L]

我希望这对你有帮助:我以前看过。但我认为这只是隐藏了扩展。我的愿望是增加一个扩展。但这似乎是双向的。我试试看。