http://advokat-malov.ru/index.php
http://advokat-malov.ru/
http://advokat-malov.ru/index.html
如何使 htaccess 将 .php 或 seo 链接(不带扩展名)重定向到 .html
如何使用 rewriteCond 和 rewriteRule 或 redirectmatch
http://advokat-malov.ru/index.php
http://advokat-malov.ru/
http://advokat-malov.ru/index.html
如何使 htaccess 将 .php 或 seo 链接(不带扩展名)重定向到 .html
如何使用 rewriteCond 和 rewriteRule 或 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