![](/img/trans.png)
[英]Redirect web pages to a new directory name without using webconfig or htaccess
[英]Redirect directory pages WITHOUT extension to WITH extension in .htaccess
如何从目录重定向页面,如
site.com/directory/ {code}(带数字和字母的代码)到site.com/directory/{code}.html
我尝试了此代码,但多次将其重定向到.html,如circle
RewriteEngine on
RewriteRule ^directory/(.*)$ directory/$1.html [R=301,L]
解
RewriteEngine on
RewriteCond %{REQUEST_URI} !(\.html)$ [NC]
RewriteRule ^directory/(.*)$ directory/$1.html [NS,L,R=301]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.