让.htm隐藏

时间:2012-09-13 11:03:48

标签: .htaccess

需要制作网站http://www.example.com/testimonials.htm 使用.htaccess到http://www.example.com/testimonials

请帮忙

2 个答案:

答案 0 :(得分:1)

试试这个

<IfModule mod_rewrite.c>
  RewriteEngine on

  RewriteCond %{REQUEST_URI} !.*\.
  RewriteRule ^(.*) /$1.htm [L,QSA]
</IfModule>

答案 1 :(得分:0)

试试这个:

RewriteEngine on

RewriteBase /

RewriteRule (.*)/$ $1 [L,QSA]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !\.htm$
RewriteRule ^(.*)$ $1.html [L,QSA]