0

我在根文件夹上安装了 wordpress。我在根文件夹内名为 smart 的子文件夹上有带有 java 脚本的工具。

在我的网站http://www.jump2health.com/smart中,该页面没有显示它应该显示的所有 java 脚本。我已经将它上传到不同的地方(http://billmath.com/smart/)并且它按预期工作。当我重命名(删除)根目录中的 .htaccess 文件时,java 脚本按预期工作,但这会阻止我的 word press 网站正常工作。

我在wordpress安装中的htaccess文件如下:

## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 2 days"
</IfModule>
## EXPIRES CACHING ##
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

我的子文件夹中没有任何 .htaccess 文件。

经过广泛搜索尝试了我在谷歌搜索结果中找到的所有内容但没有成功,我尝试在子文件夹中添加一个 .htaccess 文件:

<IfModule mod_rewrite.c>
   RewriteEngine off
</IfModule>

那也没有帮助

我尝试忽略根目录中主 htccess 文件中的文件夹,但它不起作用。

我尝试了更多,请帮我解决问题

我是 wordpress 新手

4

1 回答 1

0

尝试.htaccess像这样更新您的 Wordpress 文件:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_URI} !^/(smart|smart/.*)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

基本上如果用户试图访问/smart/目录,程序流程将不会被 Wordpress 的前端控制器执行,因此重写规则将不匹配。

RewriteCond %{REQUEST_URI} !^/(smart|smart/.*)$
于 2013-07-28T10:04:15.337 回答