English 中文(简体)
ache mod_rewrite - rescript from subdomain to main field
原标题:Apache mod_rewrite - rewriting from subdomain to main domain

我要将一架高射弹(xyz.com/123)转至Xyz.com。 因此,将检索的文档将为Xyz.com的索引.php。 该指数。 php应当既有备份,也有123份(其中123份为:SERVER[PHP_SELF],bc将来自_SERVER[HTTP_HOST],以便进行适当的处理。

abc.xyz.com 现在已经到了Xyz.com(由我的服务提供者组成),bc 可从_SERVER中提取。 HTTP_HOST。] 然而,Abc.xyz.com/123似乎正在寻找一个被Xyz.com根名录中称为123的圆顶,在无法找到任何东西时,正出现404个错误。

有些人可以向我提供将安装在“htaccess”的线路,以便用Abc.xyz.com/123来打上Xyz.com的索引.php(有123美元通过“SERVER[PHP_SELF”)? 我似乎不能让它发挥作用。

非常感谢你们的时间!

问题回答

也许是这样的:

RewriteEngine On
RewriteCond %{HTTP_HOST} .xyz.com  [NC]
RewriteRule ^(.*)$ index.php?param=$1 [L,QSA]

因此,基本上,如果吉大港定居地的东道方包含......xyz.com,(前线的存在确保只发生子主的情况),那么所有东西都会被送上索引。 不论在什么领域之后,都加上“GET[第16段]。

感谢山尔建议。 我为上述次主要次直接间接转移问题找到了解决办法。

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d  
RewriteCond %{REQUEST_URL} !=/favicon.ico
RewriteRule ^(.*)$ index.php?q=$1 [L,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 ...

热门标签