Apache 为什么mod#u rewrite不';无法在https页面上工作?
当页面没有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-_]+)
.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的情况下可以正常工作