突然,当我点击url地址时,wordpress显示了源代码,我得到了
代码只是我的站点脱机插件,所以我可以将站点设置为脱机
所以问题是,它不会将代码解析为html/php,而是将其显示为简单的源代码。。。
突然,当我点击url地址时,wordpress显示了源代码,我得到了
代码只是我的站点脱机插件,所以我可以将站点设置为脱机
所以问题是,它不会将代码解析为html/php,而是将其显示为简单的源代码。。。
问题出在。htaccess
在插件w3 total cache中,我启用了选项page cache,disk Enable I switch to disk basic。
然后在。htaccess它删除了此代码
# BEGIN W3TC Page Cache core
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP:Accept-Encoding} gzip
RewriteRule .* - [E=W3TC_ENC:_gzip]
RewriteCond %{HTTP_COOKIE} w3tc_preview [NC]
RewriteRule .* - [E=W3TC_PREVIEW:_preview]
RewriteCond %{REQUEST_METHOD} !=POST
RewriteCond %{QUERY_STRING} =""
RewriteCond %{REQUEST_URI} \\/$
RewriteCond %{HTTP_COOKIE} !(comment_author|wp\\-postpass|w3tc_logged_out|wordpress_logged_in|wptouch_switch_toggle) [NC]
RewriteCond "%{DOCUMENT_ROOT}/wp-content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index%{ENV:W3TC_PREVIEW}.html%{ENV:W3TC_ENC}" -f
RewriteRule .* "/wp-content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index%{ENV:W3TC_PREVIEW}.html%{ENV:W3TC_ENC}" [L]
只保留默认值,
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
我的问题已经解决了,在索引中再也没有问题了。php现在可以加载了。wordpress是否允许我将php文件添加到根目录以执行自定义脚本?我需要类似功能的功能。将php放入主题中。是否有任何不涉及修改配置的解决方法。php文件?