我在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个小时的博客和论坛,但却找不到任何东西。
提前感谢您的帮助。
答案 0 :(得分:0)
在wordpress中执行此操作的更简单方法是使用插件 请试试http://wordpress.org/plugins/wp-page-extension/installation/
或
http://www.introsites.co.uk/wordpress/html-on-pages-plugin.html
后者自2年以上未更新