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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.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 为什么mod#u rewrite不';无法在https页面上工作?_Apache_.htaccess_Mod Rewrite - Fatal编程技术网

Apache 为什么mod#u rewrite不';无法在https页面上工作?

Apache 为什么mod#u rewrite不';无法在https页面上工作?,apache,.htaccess,mod-rewrite,Apache,.htaccess,Mod Rewrite,当页面没有https协议时,这行.htacces代码正在工作 RewriteCond %{HTTP_USER_AGENT} (facebookexternalhit/[0-9]|Twitterbot|Pinterest|Google.*snippet) RewriteCond %{REQUEST_URI} !^/blog/$ RewriteCond %{REQUEST_URI} !^([0-9a-zA-Z-_]+)/productos$ RewriteRule ^([0-9a-zA-Z-_]+)

当页面没有https协议时,这行
.htacces
代码正在工作

RewriteCond %{HTTP_USER_AGENT} (facebookexternalhit/[0-9]|Twitterbot|Pinterest|Google.*snippet)
RewriteCond %{REQUEST_URI} !^/blog/$
RewriteCond %{REQUEST_URI} !^([0-9a-zA-Z-_]+)/productos$
RewriteRule ^([0-9a-zA-Z-_]+)/([0-9a-zA-Z-_]+)$ /admin/frontend/web/index.php/static/compartir?categorySlug=$1&productSlug=$2 [P]

但是现在,页面有了https协议,所以我把
RewriteCond%{https}!打开
,以避免500内部服务器错误,但重定向不起作用。有什么建议吗

RewriteCond %{HTTP_USER_AGENT} (facebookexternalhit/[0-9]|Twitterbot|Pinterest|Google.*snippet)
RewriteCond %{HTTPS} !on
RewriteCond %{REQUEST_URI} !^/blog/$
RewriteCond %{REQUEST_URI} !^([0-9a-zA-Z-_]+)/productos$
RewriteRule ^([0-9a-zA-Z-_]+)/([0-9a-zA-Z-_]+)$ /admin/frontend/web/index.php/static/compartir?categorySlug=$1&productSlug=$2 [P]

RewriteCond%{HTTPS}!on
特别指示mod_rewrite在启用https时不运行。不要阻止它-您应该检查为什么会出现500个错误(请参阅error.log),它在错误日志中没有给出任何信息。:/这行代码在没有https的情况下可以正常工作