久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

Mod使用GET變量將子域重寫(xiě)為PHP

Mod Rewrite Subdomain to PHP with GET variable(Mod使用GET變量將子域重寫(xiě)為PHP)
本文介紹了Mod使用GET變量將子域重寫(xiě)為PHP的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

問(wèn)題描述

我正在嘗試圍繞 mod 重寫(xiě),但似乎無(wú)法弄清楚這一點(diǎn).

I'm trying to wrap my head around mod rewrite, but can't seem to figure this out.

有什么辦法可以做到以下幾點(diǎn)嗎?

Is there a way I could do the following?

用戶輸入:http://wildcard.mydomain.com

默默地寫(xiě)信給:

http://mydomain.com/index.php?username=wildcard

推薦答案

您必須在 RewriteCond 然后在 RewriteRule.額外的 RewriteCond 用于防止 www.mydomain.comindex.php 被重寫(xiě)

You must capture the first part of the domain in a RewriteCond and then use this in a RewriteRule. The additional RewriteConds are there to prevent www.mydomain.com and index.php being rewritten

RewriteEngine on
RewriteCond %{HTTP_HOST} !^www.
RewriteCond %{REQUEST_URI} !index.php
RewriteCond %{HTTP_HOST} ^(.+?).mydomain.com$
RewriteRule .* /index.php?username=%1 [L]

但這只是所需功能的一小部分.此外,您必須為所有 username.mydomain.com 域名設(shè)置 DNS 條目或設(shè)置 通配符 DNS 條目 *.mydomain.com 指向您的主機(jī).

But this is only a small part of the needed functionality. Additionally, you must setup DNS entries for all of your username.mydomain.com domain names or setup a wildcard DNS entry *.mydomain.com pointing to your host.

否則,例如,客戶端會(huì)嘗試聯(lián)系 jcraine.mydomain.com,但找不到 DNS 條目并進(jìn)行投訴.

Otherwise, the client tries to contact jcraine.mydomain.com, for example, and doesn't find a DNS entry and complains.

如果這是虛擬主機(jī),您還必須為每個(gè)添加一個(gè) ServerAlias你的用戶名

If this is a virtual host, you must also add a ServerAlias for each of your usernames

ServerAlias jcraine.mydomain.com

或一個(gè)通配符捕獲所有子域

or a wildcard catching all subdomains

ServerAlias *.mydomain.com

這篇關(guān)于Mod使用GET變量將子域重寫(xiě)為PHP的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

Action View Helper in Zend - Work around?(Zend 中的動(dòng)作視圖助手 - 解決方法?)
Is this a good way to match URI to class/method in PHP for MVC(這是將 URI 與 PHP 中用于 MVC 的類/方法匹配的好方法嗎)
Where do I save partial (views) in Zend Framework, to be accessible for all Views in my App?(我在哪里保存 Zend Framework 中的部分(視圖),以便我的應(yīng)用程序中的所有視圖都可以訪問(wèn)?) - IT屋-程序員軟件開(kāi)發(fā)技術(shù)
Having a single entry point to a website. Bad? Good? Non-issue?(有一個(gè)網(wǎng)站的單一入口點(diǎn).壞的?好的?沒(méi)問(wèn)題?)
Is MVC + Service Layer common in zend or PHP?(MVC + 服務(wù)層在 Zend 或 PHP 中常見(jiàn)嗎?)
Hello World example in MVC approach to PHP(PHP MVC 方法中的 Hello World 示例)
主站蜘蛛池模板: 成人在线精品 | 91新视频| 国产成人av一区二区三区 | 国产一区二区三区四区五区加勒比 | 精品乱码一区二区三四区视频 | 中文在线www | 理论片午午伦夜理片影院 | 国内精品视频免费观看 | 玖玖国产| 久久精品久久久 | 美女福利视频网站 | 精品国产18久久久久久二百 | 99热在线免费 | 亚洲精品68久久久一区 | 亚洲综合色视频在线观看 | 精品视频一区二区三区 | 精品久久久一区 | 丝袜美腿一区二区三区动态图 | 99国产精品一区二区三区 | 久久精品视频一区二区三区 | 亚洲精品久久久 | 妖精视频一区二区三区 | 国产精品毛片无码 | 国产成人区 | 国产视频精品在线观看 | 亚洲第一视频 | 四虎影音 | 亚洲精品一区在线 | 女人精96xxx免费网站p | 久草免费在线视频 | 91精品一区二区三区久久久久 | 国产精品毛片 | 青青草视频免费观看 | 久久五月婷 | 亚洲精品国产成人 | 国产视频日韩 | 人人人人干 | 欧美一级久久 | 久久久国产亚洲精品 | 精品一区二区三区视频在线观看 | 狠狠躁躁夜夜躁波多野结依 |