尝试使用php目录脚本时重定向过多

尝试使用php目录脚本时重定向过多,php,regex,.htaccess,redirect,mod-rewrite,Php,Regex,.htaccess,Redirect,Mod Rewrite,我有一个PHP目录,它使用了一些htaccess行,一些行导致了太多的指令。至少浏览器上说了这一点 我认为问题与htaccess文件中下面的这一行有关,因为当我评论这一行时,我得到了404,但我不知道哪里出了问题: RewriteRule^([a-zA-Z]+)\.html$$1.php[L] RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] Options +Fo

我有一个PHP目录,它使用了一些htaccess行,一些行导致了太多的指令。至少浏览器上说了这一点

我认为问题与htaccess文件中下面的这一行有关,因为当我评论这一行时,我得到了404,但我不知道哪里出了问题:
RewriteRule^([a-zA-Z]+)\.html$$1.php[L]

RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]


Options +FollowSymLinks
Options -MultiViews
Options All -Indexes


<IfModule mod_deflate.c>
<FilesMatch "\.(js|css)$">
    SetOutputFilter DEFLATE
</FilesMatch>
</IfModule>


Header unset ETag
FileETag None
<FilesMatch "(?i)^.*\.(ico|flv|swf|jpg|jpeg|png|gif|js|css)$">
Header unset Last-Modified
Header set Expires "Fri, 21 Dec 2012 00:00:00 GMT"
Header set Cache-Control "public, no-transform"
</FilesMatch>

<FilesMatch "\.(htaccess|tpl)$">
  Order Allow,Deny
  Deny from all
</FilesMatch>

<IfModule mod_rewrite.c>
RewriteEngine On

RewriteRule ^([a-zA-Z]+)\.html$ $1.php [L]



RewriteRule ^category\/(.+/)location/(.+)$ browse_categories.php?id=$1&location=$2 [L,NC,QSA]
RewriteRule ^category\/(.+)$ browse_categories.php?id=$1 [L,NC,QSA]



RewriteRule ^location\/(.+)$ browse_locations.php?id=$1 [L,NC,QSA]


RewriteRule ^pages\/(.+)\.html$ page.php?id=$1 [L,NC]


RewriteRule ^blog.html$ blog.php [L,NC,QSA]
RewriteRule ^blog\/([^/]+)-([0-9]+).html$ blog_post.php?id=$2 [L,NC]
RewriteRule ^blog\/category\/(.+)-([0-9]+).html$ blog.php?category_id=$2 [L,NC,QSA]


RewriteRule ^out-([0-9]+)\.html$ out.php?listing_id=$1 [L]
RewriteRule ^out-([0-9]+)-([0-9]+)\.html$ out.php?listing_id=$1&banner_id=$2 [L]



RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)\.html$ listing.php?id=$1 [L,NC]
RewriteRule ^([^/]+)/images\.html$ listing_images.php?id=$1 [L,NC,QSA]
RewriteRule ^([^/]+)/send-message\.html$ listing_email.php?id=$1 [L,NC]
RewriteRule ^([^/]+)/send-message-friend\.html$ listing_email_friend.php?id=$1 [L,NC]
RewriteRule ^([^/]+)/reviews\.html$ listing_reviews.php?id=$1 [L,NC,QSA]
RewriteRule ^([^/]+)/add-review\.html$ listing_reviews_add.php?id=$1 [L,NC]
RewriteRule ^([^/]+)/classifieds\.html$ listing_classifieds.php?id=$1 [L,NC,QSA]
RewriteRule ^([^/]+)/locations\.html$ listing_locations.php?id=$1 [L,NC,QSA]
RewriteRule ^([^/]+)/documents\.html$ listing_documents.php?id=$1 [L,NC,QSA]
RewriteRule ^([^/]+)/events\.html$ listing_events.php?id=$1 [L,NC,QSA]
RewriteRule ^([^/]+)/jobs\.html$ listing_jobs.php?id=$1 [L,NC,QSA]
RewriteRule ^([^/]+)/suggestion\.html$ listing_suggestion.php?id=$1 [L,NC]
RewriteRule ^([^/]+)/claim\.html$ listing_claim.php?id=$1 [L,NC]


RewriteRule ^classified/[^/]+-([0-9]+)\.html$ classified.php?id=$1 [L,NC,QSA]
RewriteRule ^classified/[^/]+-([0-9]+)/images\.html$ classified_images.php?classified_id=$1 [L,NC]


RewriteRule ^event/[^/]+-([0-9]+)\.html$ event.php?id=$1 [L,NC,QSA]


RewriteRule ^job/[^/]+-([0-9]+)\.html$ job.php?id=$1 [L,NC,QSA]


RewriteRule ^sitemap.xml$ xml.php?type=sitemap [L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ 404.php?id=$1 [L,NC]

</IfModule>
RewriteCond%{HTTPS}关闭
重写规则^(.*)$https://%{HTTP_HOST}%{REQUEST_URI}[L,R=301]
选项+FollowSymLinks
选项-多视图
选项所有-索引
SetOutputFilter放气
标题未设置ETag
FileTag无
上次修改未设置的标题
标题集过期“2012年12月21日星期五00:00:00 GMT”
标题集缓存控制“公共,无转换”
命令允许,拒绝
全盘否定
重新启动发动机
重写规则^([a-zA-Z]+)\.html$$1.php[L]
重写规则^category\/(.++/)location/(.++)$browse_categories.php?id=$1&location=$2[L,NC,QSA]
重写规则^category\/(.+)$browse\u categories.php?id=$1[L,NC,QSA]
重写规则^location\/(.+)$browse\u locations.php?id=$1[L,NC,QSA]
重写规则^pages\/(.+)\.html$page.php?id=$1[L,NC]
重写规则^blog.html$blog.php[L,NC,QSA]
重写规则^blog\/([^/]+)-([0-9]+).html$blog_post.php?id=$2[L,NC]
重写规则^blog\/category\/(.+)-([0-9]+).html$blog.php?category_id=$2[L,NC,QSA]
重写规则^out-([0-9]+)\.html$out.php?清单\u id=$1[L]
重写规则^out-([0-9]+)-([0-9]+)\.html$out.php?列表\u id=$1和横幅\u id=$2[L]
重写cond%{REQUEST_FILENAME}-D
重写cond%{REQUEST_FILENAME}-F
重写规则^([^/]+)\.html$listing.php?id=$1[L,NC]
重写规则^([^/]+)/images\.html$listing_images.php?id=$1[L,NC,QSA]
重写规则^([^/]+)/send message\.html$listing_email.php?id=$1[L,NC]
重写规则^([^/]+)/send message friend\.html$listing\u email\u friend.php?id=$1[L,NC]
重写规则^([^/]+)/reviews\.html$listing_reviews.php?id=$1[L,NC,QSA]
重写规则^([^/]+)/add review\.html$listing\u reviews\u add.php?id=$1[L,NC]
重写规则^([^/]+)/classifieds\.html$listing_classifieds.php?id=$1[L,NC,QSA]
重写规则^([^/]+)/locations\.html$listing_locations.php?id=$1[L,NC,QSA]
重写规则^([^/]+)/documents\.html$listing_documents.php?id=$1[L,NC,QSA]
重写规则^([^/]+)/events\.html$listing_events.php?id=$1[L,NC,QSA]
重写规则^([^/]+)/jobs\.html$listing_jobs.php?id=$1[L,NC,QSA]
重写规则^([^/]+)/suggestion\.html$listing_suggestion.php?id=$1[L,NC]
重写规则^([^/]+)/claim\.html$listing_claim.php?id=$1[L,NC]
重写规则^classified/[^/]+-([0-9]+)\.html$classified.php?id=$1[L,NC,QSA]
重写规则^classified/[^/]+-([0-9]+)/images\.html$classified\u images.php?classified\u id=$1[L,NC]
重写规则^event/[^/]+-([0-9]+)\.html$event.php?id=$1[L,NC,QSA]
重写规则^job/[^/]+-([0-9]+)\.html$job.php?id=$1[L,NC,QSA]
重写规则^sitemap.xml$xml.php?type=sitemap[L]
重写cond%{REQUEST_FILENAME}-D
重写cond%{REQUEST_FILENAME}-F
重写规则^(.*)$404.php?id=$1[L,NC]

我应该会看到我被重定向到的页面。

您是否尝试查看发生了什么?请从您发布的文件中删除所有与您的问题无关的内容。这样一堵代码墙会赶走大多数愿意帮助你的人。你看,你需要让别人更容易帮助你,这是你的责任。你不能简单地把所有的东西都扔到每个人的脚下,期望人们对此感到高兴……你有没有试着去看看发生了什么?请从你发布的文件中删除所有与你的问题无关的东西。这样一堵代码墙会赶走大多数愿意帮助你的人。你看,你需要让别人更容易帮助你,这是你的责任。你不能简单地把所有的东西都扔在每个人的脚下,期望人们为此感到高兴。。。