Apache 请求URI重写,包括查询字符串
我有一个WordPress插件和主题,它们对外部css文件的URL调用的格式不正确。我将在以后解决这个问题,但在那之前,我需要做一个重定向,以便css得到正确的服务 请求URI包含完整的路径,那么为什么这不起作用呢Apache 请求URI重写,包括查询字符串,apache,mod-rewrite,url-rewriting,query-string,request-uri,Apache,Mod Rewrite,Url Rewriting,Query String,Request Uri,我有一个WordPress插件和主题,它们对外部css文件的URL调用的格式不正确。我将在以后解决这个问题,但在那之前,我需要做一个重定向,以便css得到正确的服务 请求URI包含完整的路径,那么为什么这不起作用呢 <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_URI} ^/?wp-content/plugins/jetpack/css/%22https:/fonts.goo
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^/?wp-content/plugins/jetpack/css/%22https:/fonts.googleapis.com/css?family=Open+Sans%22$ [NC,OR]
RewriteCond %{REQUEST_URI} ^/?wp-content/plugins/jetpack/css/"https:/fonts.googleapis.com/css?family=Open+Sans"$
RewriteRule ^(.*)$ https://fonts.googleapis.com/css?family=Open+Sans [R,L]
</IfModule>
使用WordPress时,请记住将您的重写置于WordPress重写之上
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^/?wp-content/plugins/jetpack/css/%22https:/fonts.googleapis.com/css(.*)$ [NC,OR]
RewriteCond %{REQUEST_URI} ^/?wp-content/plugins/jetpack/css/"https:/fonts.googleapis.com/css(.*)$
RewriteRule ^(.*)$ https://fonts.googleapis.com/css?family=Open+Sans [R,L]
</IfModule>