http://advokat-malov.ru/index.php
http://advokat-malov.ru/
http://advokat-malov.ru/index.html
如何将htaccess重定向.php或seo链接(不带扩展名)转换为.html
如何使用rewriteCond和rewriteRule或redirectmatch
制作它答案 0 :(得分:0)
这将有效
# 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