Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache 忽略.htaccess中的特定URL_Apache_.htaccess_Mod Rewrite - Fatal编程技术网

Apache 忽略.htaccess中的特定URL

Apache 忽略.htaccess中的特定URL,apache,.htaccess,mod-rewrite,Apache,.htaccess,Mod Rewrite,我的.htaccess文件中有一组标准的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> 我尝试将

我的.htaccess文件中有一组标准的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>
我尝试将此规则添加到WordPress重写之上:

RewriteRule ^css - [L,NC]
但这似乎不起作用。如何让浏览器加载URL而不进行任何重写

这是i文件夹中index.php文件中的代码,可能与重定向有关,我不确定它来自何处:

<?php
// Include placeholder generator class
require('placeholder.class.php');

// Get variables from $_GET
$width           = isset($_GET['w']) ? trim($_GET['w']) : null;
$height          = isset($_GET['h']) ? trim($_GET['h']) : null;
$backgroundColor = isset($_GET['bgColor']) ? strtolower(trim($_GET['bgColor'])) : null;
$textColor       = isset($_GET['textColor']) ? strtolower(trim($_GET['textColor'])) : null;
$cache           = isset($_GET['c']) && $_GET['c'] == 1 ? true : false;

try {
    $placeholder = new Placeholder();
    $placeholder->setWidth($width);
    $placeholder->setHeight($height);
    $placeholder->setCache($cache);
    if ($backgroundColor) $placeholder->setBackgroundColor($backgroundColor);
    if ($textColor) $placeholder->setTextColor($textColor);
    $placeholder->render();
} catch (Exception $e){
    die($e->getMessage());
}
谢谢

而不是

RewriteRule ^css - [L,NC]
试一试


您可以告诉它忽略wp内容文件夹,这样它就不会进行重写

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_URI} !^/wp-content [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

嗯,这两个建议在这种情况下都不起作用。我想知道重定向是否没有在.htaccess级别发生。我将在我的原始问题中发布I文件夹的index.php文件的内容。请参见下面的同一评论。htaccess文件的位置在哪里?站点的根目录。请尝试清除浏览器缓存或在其他浏览器中尝试。这条规则应该行得通。我已经做到了,但仍然不起作用。要么我这里有点问题,要么重定向没有通过.htaccess发生。我可以在这里发布真实的URL,但我不认为堆栈溢出喜欢这种事情。
RewriteRule ^wp-content/themes/jarvis_wp/css/i - [L]
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_URI} !^/wp-content [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>