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

时间:2013-09-12 09:54:15

标签: wordpress

我在wordpress页面上创建了一个html设计。默认情况下,wordpress页面没有任何扩展名。为了使页面扩展名为.html,我在.htaccess文件中添加了以下代码并编辑了该文件的永久链接。页面as.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

我现在已经阅读了大约5个小时的博客和论坛,但却找不到任何东西。

提前感谢您的帮助。

1 个答案:

答案 0 :(得分:0)

在wordpress中执行此操作的更简单方法是使用插件 请试试http://wordpress.org/plugins/wp-page-extension/installation/

http://www.introsites.co.uk/wordpress/html-on-pages-plugin.html

后者自2年以上未更新