如何使的.htaccess重定向各个环节为.html后缀后缀、重定向、环节、htaccess

由网友(今晚月亮缺席)分享简介:http://advokat-malov.ru/index.phphttp://advokat-malov.ru/ http://advokat-malov.ru/index.html如何让htaccess的重定向的.php,或SEO链接(不带扩展名)为.html how to make htaccess red...
http://advokat-malov.ru/index.php
http://advokat-malov.ru/ 
http://advokat-malov.ru/index.html

如何让htaccess的重定向的.php,或SEO链接(不带扩展名)为.html

how to make htaccess redirect .php, or seo links(without extension) to .html

如何使用的RewriteCond和重写规则,或redirectmatch使

how to make it using rewriteCond and rewriteRule or redirectmatch

推荐答案

这将工作

# This will change all .php to .html
RewriteEngine on
RewriteBase /
RewriteRule ^(.*).html$ $1.php [L]


# This will add .html to all urls that are not in the white list
# White list extensions php, html, css, js, less, jpg, png, gif
RewriteEngine On
RewriteCond %{REQUEST_URI} !.(php|html|css|js|less|jpg|png|gif)$
RewriteCond %{REQUEST_URI} !/$
RewriteRule ^(.*)$ $1.html
阅读全文

相关推荐

最新文章