English 中文(简体)
基于URL的检测和再定位
原标题:detect and redirect based on URL

我的<代码>.htaccess有以下条件: 档案:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^ex.co$
RewriteRule ^(.*)$ http://example.com/?ref=$1 [L,R]

这将向<条码>ex.coxx至example.com?ref=xxxx

What I want is to add a line that if a user simply goes to ex.co it redirects to example.com and not (as it does currently) example.com?ref=

任何建议?

Thanks!

最佳回答

I think you just need to add the third line below:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^ex.co$
RewriteRule ^$     http://example.com [L,R]
RewriteRule ^(.*)$ http://example.com/?ref=$1 [L,R]
问题回答

暂无回答




相关问题
IIS 6.0 hangs when serving a web-service

I am having issues with one of our web-services. It works fine on my development machine (win XP) whether I host it as a separate application or using cassini from Visual studio. Once I deploy on the ...

ASP.net web services

I am using a web service which sets the Thread.CurrentPrincipal object while logging in and soon later when another webmethod of the same web service accesses Thread.CurrentPrincipal, its different/...

Unity Container Disposing and XML Web Service

I am registering some wrapers over un-managed objects in container. How can I dispose of them at the end of the container s lifetime? Please bear in mind I have an XML Web service.

SharePoint : web service permission error

I have a sharepoint site, and I am calling a standard sharepoint web service. I create the web service request like this : wsDws.Url = this.SiteAddress + @"/_vti_bin/Dws.asmx"; When I use ...

热门标签