Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.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
.htaccess 导致重定向的新htaccess.html规则_.htaccess_Mod Rewrite - Fatal编程技术网

.htaccess 导致重定向的新htaccess.html规则

.htaccess 导致重定向的新htaccess.html规则,.htaccess,mod-rewrite,.htaccess,Mod Rewrite,请有人帮忙,我们的htaccess有问题 我们已经创建了一个规则,将所有ending.html(我们的产品页面)发送到details.cfm页面。但是,创建此规则后,我们的管理区域子目录将重定向到索引页 我们设置好了吗?我想我们这里有个错误 # Rewrite rules for non www entrances RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} !^www.ourdomain.co.uk$ [NC] Rewrite

请有人帮忙,我们的htaccess有问题

我们已经创建了一个规则,将所有ending.html(我们的产品页面)发送到details.cfm页面。但是,创建此规则后,我们的管理区域子目录将重定向到索引页

我们设置好了吗?我想我们这里有个错误

# Rewrite rules for non www entrances
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www.ourdomain.co.uk$ [NC]
RewriteRule ^(.*)$ http://www.ourdomain.co.uk/$1 [L,R=301]


# Rewrite rules - new rule
RewriteRule (.*).html$ /Details.cfm?ProductUrl=$1 [NC]

# Rewrite rules - current rules
RewriteRule (.*)-sku-(.*)$ /Details.cfm?Name=$1&ProductCode=$2 [NC]
RewriteRule (.*)-shop-(.*)$ /Results.cfm?bname=$1&Brand=$2 [NC]
RewriteRule (.*)-cat1-(.*)$ /SubCat.cfm?catname=$1&category=$2 [NC]
RewriteRule (.*)-cat2-(.*)$ /SubSubCat.cfm?secondcatname=$1&secondary=$2 [NC]
RewriteRule (.*)-cat3-(.*)$ /Results.cfm?thirdcatname=$1&third=$2 [NC]
RewriteRule (.*)-shop$ /ResultsShop.cfm?bname=$1 [NC]

# Rewrite rule - If no extension specified use cfm
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.cfm -f
RewriteRule ^(.*)$ $1.cfm

# Rwerite rule - 404 redirect rule
ErrorDocument 404 /cferror.cfm

# Gzip rule to speed up website with image caching
<ifModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>

谢谢

RewriteBase/
行下方添加此规则:

# skip v3 from rewrite
RewriteRule ^v3(/.*)?$ - [NC,L]

对于哪个URL,您会收到404或500错误?感谢您的回复:-)当我们转到ourdomain.co.uk/v3@anubhava时,它会重定向到rootSo问题是您得到无限重定向循环,或者只是想修复此不需要的重定向?@anubhava只是为了修复不需要的重定向,我们想从重定向中排除此目录。谢谢@anubhava,但它不起作用。当我们删除此规则时,它会再次工作#重写规则-新规则重写规则(.*.html$/Details.cfm?ProductUrl=$1[NC]该规则与
/v3
URL没有链接。尝试添加
RewriteCond%{REQUEST\u FILENAME}-在v3目录中进行进一步调查之后,我们还有另一个htaccess文件,因此我们使用htpasswd,难以从注释中读取代码。编辑你的问题并在那里提供这些信息。不是真的,只是需要安全的密码保护@anubhava
# skip v3 from rewrite
RewriteRule ^v3(/.*)?$ - [NC,L]