我想将wordpress页面扩展名设为.html

我想将wordpress页面扩展名设为.html,wordpress,Wordpress,我在wordpress页面上创建了一个html设计。默认情况下,wordpress页面没有任何扩展名。为了使页面扩展名为.html,我在.htaccess文件中添加了以下代码,并将该页面的永久链接编辑为.html,但最终出现404错误 # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /wordpress_com/ #code added by me RewriteCond %{REQU

我在wordpress页面上创建了一个html设计。默认情况下,wordpress页面没有任何扩展名。为了使页面扩展名为.html,我在.htaccess文件中添加了以下代码,并将该页面的永久链接编辑为.html,但最终出现404错误

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wordpress_com/

#code added by me 
RewriteCond %{REQUEST_URI} !^.*\.html$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ $1.html [L,R=301] 
#code ends here
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress_com/index.php [L]

</IfModule>

# END WordPress
#开始WordPress
重新启动发动机
RewriteBase/wordpress\u com/
#由我添加的代码
重写条件%{REQUEST_URI}!^.*\。html$
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则^(.*)$$1.html[L,R=301]
#代码到此结束
重写规则^index\.php$-[L]
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则/wordpress_com/index.php[L]
#结束WordPress
我已经读了大约5个小时的博客和论坛了,什么都想不出来


提前感谢您的帮助。

在wordpress中,更简单的方法是使用pluin 请试试这个

后者的更新时间超过2年