.htaccess 忽略一个特定Laravel视图的HTTPS重写

.htaccess 忽略一个特定Laravel视图的HTTPS重写,.htaccess,laravel,.htaccess,Laravel,我们有一个Laravel5.2Web应用程序,它通过.htaccess重写强制HTTPS和剥离www 然而,我们希望通过HTTP提供一个特定的URL/视图 以下是我们当前的.htaccess: <IfModule mod_rewrite.c> <IfModule mod_negotiation.c> Options -MultiViews </IfModule> RewriteEngine On RewriteCond %{HTTP_HOST} ^www\

我们有一个Laravel5.2Web应用程序,它通过.htaccess重写强制HTTPS和剥离www

然而,我们希望通过HTTP提供一个特定的URL/视图

以下是我们当前的.htaccess:

<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>

RewriteEngine On

RewriteCond %{HTTP_HOST} ^www\. [NC,OR]
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC]
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
RewriteRule ^ https://%1%{REQUEST_URI} [R=302,L,NE] 


# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$   
RewriteRule ^(.*)/$ /$1 [L,R=301]

# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
RewriteRule ^ index.php [L]

# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>

选项-多视图
重新启动发动机
重写cond%{HTTP_HOST}^www\。[北卡罗来纳州,或]
重写条件%{HTTPS}关闭
重写cond%{HTTP_HOST}^(?:www\)?(.+)$[NC]
重写cond%{REQUEST_URI}^/[0-9]+\..+\.cpaneldcv$
重写cond%{REQUEST_URI}^/[A-F0-9]{32}\.txt(?:\comdo\DCV)$
重写条件%{REQUEST\u URI}!^/\。著名的/acme挑战赛/[0-9a-zA-Z_-]+$
重写规则^https://%1%{REQUEST_URI}[R=302,L,NE]
#如果不是文件夹,则重定向尾部斜杠。。。
重写cond%{REQUEST_FILENAME}-D
重写cond%{REQUEST_URI}^/[0-9]+\..+\.cpaneldcv$
重写cond%{REQUEST_URI}^/[A-F0-9]{32}\.txt(?:\comdo\DCV)$
重写条件%{REQUEST\u URI}!^/\。著名的/acme挑战/[0-9a-zA-Z_-]+$
重写规则^(.*)/$/$1[L,R=301]
#处理前控制器。。。
重写cond%{REQUEST_FILENAME}-D
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_URI}^/[0-9]+\..+\.cpaneldcv$
重写cond%{REQUEST_URI}^/[A-F0-9]{32}\.txt(?:\comdo\DCV)$
重写条件%{REQUEST\u URI}!^/\。著名的/acme挑战赛/[0-9a-zA-Z_-]+$
重写规则^index.php[L]
#句柄授权头
RewriteCond%{HTTP:Authorization}。
重写cond%{REQUEST_URI}^/[0-9]+\..+\.cpaneldcv$
重写cond%{REQUEST_URI}^/[A-F0-9]{32}\.txt(?:\comdo\DCV)$
重写条件%{REQUEST\u URI}!^/\。著名的/acme挑战赛/[0-9a-zA-Z_-]+$
重写规则。*-[E=HTTP\U授权:%{HTTP:AUTHORIZATION}]
我尝试添加
RewriteCond%{REQUEST\u URI}^/foo
重写规则^https://%1%{REQUEST_URI}[R=302,L,NE]之前的行上

这可以忽略该路径的重定向,但问题是该路由由Laravel处理,没有具有该名称的实际文件。我们需要将数据传递给视图,并让Laravel返回此URL的内容


我们如何在不干扰Laravel路由的情况下忽略对该URL的重写,或者在Laravel处理后将URL重写为http?

当条件满足您的要求时,请求将由Laravel处理。那么问题是什么呢?