English 中文(简体)
Subdomain Rewrite Rule to transfer URL Params to otherDirector?
原标题:Subdomain RewriteRule to transfer URL Params to other directories?

我的问题是: 我希望有一部改写规则,使我能够把参数转给我的服务器上的另一台名录。 我称之为我网页的子主,这一次主要应放在我根页的“正常”目录上。 除此规则外,还应增加所有ur的参数。

例:

Root-Page: http://www.example.com -> directory on the server /srv/www/vhosts/example.com/httpdocs/

Subdomain: http://fb.example.come 

现在,根基-Page和Subdomain应指出同一名录:

Subdomain ->Directory on the services /srv/www/vhosts/example.com/http://docs/

The difference between both domains is a paramenter that should add to every URL call:

User-Call: http://fb.example.com/index.php
--> add a fb=1 param
Intern -> http://fb.example.com/index.php?fb=1

User-Call: http://fb.example.com/show.php?param=1&test=1
--> add a fb=1 param
Intern -> http://fb.example.com/show.php?fb=1&param=1&test=1

There should always be a param called "fb=1" in the URL.

如何做到这一点?

最佳回答
RewriteCond %{QUERY_STRING} !fb=1
RewriteCond %{HTTP_HOST} ^fb.
RewriteRule (.*) $1?fb=1 [QSA]

但是,我只是把一些法典放在你的实验室中,以发现fb.example.com领域。 更清洁

if($_SERVER["HTTP_HOST"]=="fb.example.com")
  $fb = true;
问题回答

暂无回答




相关问题
Using SimplePie with CodeIgniter and XAMPP

I am using CodeIgniter 1.7.2 with XAMPP 1.7.2 on a Windows computer. I am trying to make use of SimplePie. I followed all the instructions I could find: a copy of simplepie.inc is in my applications/...

Multiple Sites with common files

I have developed over 50 sites that all use the exact same files other than CSS and IMAGES, I currently duplicate the files each time I create a new site and upload different css and images. What ...

http server validation

I finish a litle http server, writing from scratch. I would like to be sure that my imlementation is conforme to the HTTP specifications. W3C give us tools for HTML/XML conformance, but i see nothing ...

热门标签