青蛙CMS htaccess诊断

时间:2014-09-23 14:35:53

标签: .htaccess

我有一个问题,Frog CMS,它是我第一次使用这个CMS,是一个使用它的客户端。

场景:我使用名为“重定向器”的插件修改了1个重定向,该插件破坏了整个站点!

幸运的是,我在几个月前找到了一个htaccess,允许该网站工作,但重定向没有一个工作,网站工作,但没有重定向,该网站的主要网址重写似乎是好的,但是我需要301重定向,不行。

我无法弄清楚为什么会发生这种情况,为什么这种重定向不正常,它们不会发生冲突,但它们什么都不做!你能就此提出建议吗?我期待着更多地了解网址重写和htaccess。

我无法使用该插件生成重定向,因为它会破坏整个网站。如果有一种方法可以“重置”在这个CMS中重写的网址,这将是好的,但我没有合作从网站的开发者......

我感谢任何帮助,以便更好地了解错误,为什么所有

 RewriteRule ^site/services/immigration/ /services/immigration.html [L,R=301] 

不工作!

### CMS-Generated Update August 1, 2013, 1:45 pm ###

#
# Setting Frog requirements
#
AddType text/x-component .htc
AddType video/ogg .ogm
AddType video/ogg .ogv
AddType video/ogg .ogg
AddType video/webm .webm
AddType video/mp4 .mp4
AddType video/x-m4v .m4v
AddType audio/webm .weba
AddDefaultCharset UTF-8
Options -Indexes -MultiViews +FollowSymLinks
DirectoryIndex index.html index.php
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !.local$ [NC]
RewriteCond %{HTTP_HOST} !.local$ [NC]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
RewriteRule ^install/index.html$ install/index.php?rewrite=1 [L,QSA]
RewriteRule ^install/index.php$ install/index.php?rewrite=1 [L,QSA]
RewriteRule ^install/$ install/index.php?rewrite=1 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^admin(.*)$ admin/index.php?$1 [L,QSA]
RewriteCond %{DOCUMENT_ROOT}/cache/index.html -f
RewriteRule ^$ /cache/index.html [L,QSA]
RewriteCond %{REQUEST_METHOD} ^GET$
RewriteCond %{DOCUMENT_ROOT}/cache/%{REQUEST_URI} -f
RewriteRule ^(.*)$ /cache/$1 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^download/(.*)$ /downloads.php?THISPAGE=download.html&media=pdf&filename=$1 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^private/(.*)$ /private.html?THISPAGE=private.html&userfile=$1 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^mobile/search/(.*)$ mobile.html?THISPAGE=search.html&media=mobile&search=$1 [L,QSA]
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{REQUEST_FILENAME} !-l
#RewriteRule ^mobile/(.*)/process.html$ mobile.html?THISPAGE=$1&media=mobile&return=process [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^mobile/(.*)/success.html$ mobile.html?THISPAGE=$1&media=mobile&return=success [L,QSA]
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^standard/search/(.*)$ standard.html?THISPAGE=search.html&media=standard&search=$1 [L,QSA]
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{REQUEST_FILENAME} !-l
#RewriteRule ^standard/(.*)/process.html$ standard.html?THISPAGE=$1&media=standard&return=process [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^standard/(.*)/success.html$ standard.html?THISPAGE=$1&media=standard&return=success [L,QSA]
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{REQUEST_FILENAME} !-l
#RewriteRule ^(.*)/process.html$ contact.html?THISPAGE=$1&return=process [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.*)/success.html$ contact.html?THISPAGE=$1&return=success [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^search/(.*)$ index.php?THISPAGE=search.html&search=$1 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^proposal.html$ index.php?THISPAGE=$1&media=proposal [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^contrast/search/(.*)$ contrast.html?THISPAGE=search.html&search=$1&media=contrast [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^print/search/(.*)$ print.html?THISPAGE=search.html&search=$1&media=print [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^mobile/(.*)$ mobile.html?THISPAGE=$1&media=mobile [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^standard/(.*)$ standard.html?THISPAGE=$1&media=standard [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^print/(.*)$ print.html?THISPAGE=$1&media=print [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^pdf/(.*)$ pdf.html?THISPAGE=$1&media=pdf [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^proposal/(.*)$ proposal.html?THISPAGE=$1&media=proposal [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^flash/(.*)$ flash.html?THISPAGE=$1&media=flash [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^contrast/(.*)$ contrast.html?THISPAGE=$1&media=contrast [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.*)$ index.php?THISPAGE=$1 [L,QSA]
RewriteRule ^/site/aboutus/(.*)$ /$1 [L,R=301]
RewriteRule ^site/aboutus/ / [L,R=301]
RewriteRule ^pages/about_us.htm /about.html [L,R=301]
RewriteRule ^site/contact/ /contact.html [L,R=301]
RewriteRule ^site/library/ /resources.html [L,R=301]
RewriteRule ^site/services/ /services.html [L,R=301]
RewriteRule ^site/services/alternative_dispute_resolution/ /services/alternative-dispute-resolution.html [L,R=301]
RewriteRule ^site/services/business_visas/ /services/business-visas.html [L,R=301]
RewriteRule ^site/services/civil_comm_litigation/ /services/civil-commercial-litigation-copy.html [L,R=301]
RewriteRule ^site/services/clinical_negligence/ /services/clinical-negligence.html [L,R=301]
RewriteRule ^site/services/conveyancing/commercial/ /services/commercial-conveyancing.html [L,R=301]
RewriteRule ^site/services/company_law/ /services/company-law.html [L,R=301]
RewriteRule ^site/services/criminal_law/ /services/criminal-law.html [L,R=301]
RewriteRule ^site/services/divorce_matrimonial/ /services/divorce-matrimonial.html [L,R=301]
RewriteRule ^site/services/employment_law/ /services/employment-law.html [L,R=301]
RewriteRule ^site/services/human_rights/ /services/human-rights-issues.html [L,R=301]
RewriteRule ^site/services/immigration/ /services/immigration.html [L,R=301]
RewriteRule ^site/services/leases_tenancy/ /services/leases-tenancy-agreements.html [L,R=301]
RewriteRule ^site/services/injury_medical_negligence/ /services/personal-injury-medical-negligence.html [L,R=301]
RewriteRule ^site/services/pro_bono/ /services/pro-bono.html [L,R=301]
RewriteRule ^site/services/conveyancing/ /services/residential-conveyancing.html [L,R=301]
RewriteRule ^site/services/conveyancing/residential/ /services/residential-conveyancing.html [L,R=301]
RewriteRule ^site/services/wills_trusts_probates/ /services/wills-trusts-probates.html [L,R=301]
RewriteRule ^site/people/ /team.html [L,R=301]
</IfModule>

1 个答案:

答案 0 :(得分:0)

这是因为您之前所有其他服务重定向规则都有此规则:

RewriteRule ^site/services/ /services.html [L,R=301]

这就是说,&#34; /site/services/开头的任何内容都会被重定向到/services.html&#34;。所以,当你有一个规则,如:

RewriteRule ^site/services/company_law/ /services/company-law.html [L,R=301]

之后,第二条规则永远不会被执行,因为第二条规则匹配/site/services/company_law /site/services/开头,因此匹配第一条规则。您需要重新排序所有规则,以便更一般的规则在最后。

RewriteRule ^site/services/ /services.html [L,R=301]

最底层的规则。