English 中文(简体)
罗马尼亚 以某些条件为根据的规范
原标题:URL Rewrite rule based on certain conditions

我正在根据我的存取档案中的某些条件适用URL重写规则,但由于我几乎对使用Appa .htacces的URL重写有零的认识,我已经这样做。 这里,我的使用情况

i 我的“压力”应用中仅有很少的缩略语,而那些用于某些中央支助事务和Javales的假想则想,这些URLs应当从光盘服务器中服务,因为有些问题不能使用简单的改写法,因为那一件事情正在打破我的应用功能。

http://www.mydomain.com/wp-content/plugins/pluginA/abc.css
http://www.mydomain.com/wp-content/plugins/pluginA/abc.js

i 想要的是,当国家安全局和共同财产局来自这一gin(Plugin A)或其他任何想要改写的花gin时,《欧洲统一法》应当改写。

http://www.cdn.mydomain.com/wp-content/plugins/pluginA/abc.css
http://www.cdn.mydomain.com/wp-content/plugins/pluginA/abc.js

i am not sure how to do such conditional based URL rewriting,Any suggestion will really be helpful

Edit This is my current .htaccess file in the root

<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteBase /wordpress/
RewriteCond %{QUERY_STRING} (<|%3C).*script.*(>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} _REQUEST(=|[|\%[0-9A-Z]{0,2})
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
</IfModule>

i) 在<代码>上建立了新的<代码>。 按<代码>Michael的建议,在以下条目下注明:

RewriteEngine On
<IfModule mod_rewrite.c>
RewriteBase  /wordpress/
RewriteCond %{REQUEST_FILENAME} ^.+.(css|js)$
RewriteRule wp-content/plugins/(nivo-slider-light|Usernoise|lightbox-plus|wp-content-slideshow|content-slide)/(.+)$ http:/cdn.cloudfront.net/wp-content/plugins/$1/$2 [L,R=302,QSA]
</IfModule>

但这似乎并不像现在这样运作,因为从当地托管人而不是从我的CDN服务器上向URL公司提供所有 c和 j。 我甚至从我的生子中评论了这些内容。

 RewriteCond %{QUERY_STRING} (<|%3C).*script.*(>|%3E) [NC,OR]
 RewriteCond %{QUERY_STRING} GLOBALS(=|[|\%[0-9A-Z]{0,2}) [OR]
 RewriteCond %{QUERY_STRING} _REQUEST(=|[|\%[0-9A-Z]{0,2})

但这也没有对《欧洲刑法》作出任何改动。

最佳回答

可在根基目录内安装。 您希望重写的任何缩略语可放在<条码>(>)内,代之以<条码>。

RewriteEngine On
# Rewrite pluginA plugin X, and pluginZ to the CDN. Add add more with |
RewriteRule wp-content/plugins/(pluginA|pluginX|pluginZ)/(.+)$ http:/www.cdn.mydomain.com/wp-content/plugins/$1/$2 [L,R=301,QSA]

注:上述文件重写了所有原始档案。 如果它只应是混杂物,则使用卷宗。

RewriteCond %{REQUEST_FILENAME} .(css|js)$
RewriteRule wp-content/plugins/(pluginA|pluginX|pluginZ)/(.+)$ http:/www.cdn.mydomain.com/wp-content/plugins/$1/$2 [L,R=301,QSA]
问题回答

暂无回答




相关问题
URL rewrite in IIS6 - Third party tools

I have collected the following api/sdk/whatever which provide modules for doing url rewriting in IIS 5/6/7. Some are free-open source and some require $. I haven t tried any of them. I would like to ...

Rewrite spring-security redirect URLs

I m trying to get Tuckey UrlRewriteFilter to tidy up URLs for my webapp. One problem I ve got is that when spring-security notices that an anonymous user is trying to access a protected resource it ...

ASP.NET Friendly URLs

In my research, I found 2 ways to do them. Both required modifications to the Application_BeginRequest procedure in the Global.Asax, where you would run your code to do the actual URL mapping (mine ...

Could I get by HttpModule the URL that contains * before?

My web-site is working under ASP.NET 3.5, IIS7, Integrated pipiline mode. My HttpModule is getting request to all resources, including URLs like this: http://my-site.com/address And I would support *...

Domains & Foreward Slash

This is rather difficult to explain so please bear with me. We will be hosting 4 websites on our server and the plan is to have each site sit under its own domain: site-a.com site-b.com sub1.site-b....

URL Mod-Rewrite

I currently have a working URL: http://example.com/security-services.php?service=fixed-camera-surveillance and then I have PHP say, $_REQUEST[ service ] to do some stuff... But I d like to ...

热门标签