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

Symfony 動態(tài)子域

Symfony dynamic subdomains(Symfony 動態(tài)子域)
本文介紹了Symfony 動態(tài)子域的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

限時(shí)送ChatGPT賬號..

我正在嘗試將子域與 symfony 中的客戶 ID 匹配.

I'm trying to match subdomains to a customer id in symfony.

即我有 customer1.example.com 和 customer2.example.com

i.e. i have customer1.example.com and customer2.example.com

域存儲在表中.

當(dāng)用戶訪問 customer1.example.com 時(shí),我想獲取子域,在數(shù)據(jù)庫中查找域名,匹配后,它將為該客戶部署應(yīng)用程序配置,然后將 customer_Id 存儲在一個(gè)全局屬性,所以我確切地知道我在整個(gè)應(yīng)用程序中與哪個(gè)客戶打交道.虛擬主機(jī)將具有相關(guān)的通配符服務(wù)器名稱.

When a user goes to customer1.example.com, I would like to get the subdomain, look up the domain name in the database, once matched, it will then deploy the app config for that customer and then store the customer_Id in a global attribute so i know exactly which customer I'm dealing with througout the whole application. The virtual host will have the relevant wildcard servername.

您是否設(shè)法實(shí)現(xiàn)了這一目標(biāo),如果是,如何實(shí)現(xiàn)?如果沒有,任何想法都會有很大幫助!

Have you managed to achieve this, and if so, how? If not, any ideas would be a great help!

我正在考慮使用過濾器來做到這一點(diǎn).

I'm thinking about using a filter to do it.

:-)

推薦答案

還需要將您的域設(shè)置為通配符域,否則您將需要為每個(gè)客戶端手動創(chuàng)建每個(gè)子域.

also going to be needing yo set your domain as a wildcard domain, if not you going to need to create manually each subdomain per client.

另一個(gè)不太依賴于 symphony 的解決方案是使用 .htaccess

another solution that is not so symphony dependent is using a .htaccess

    <IfModule mod_rewrite.c>
   Options +FollowSymLinks
   Options +Indexes
   RewriteEngine On
   RewriteBase /
   RewriteCond %{HTTP_HOST} !www.domain.com$ [NC]
   RewriteCond %{HTTP_HOST} ^(www.)?([a-z0-9-]+).domain.com [NC]
   RewriteRule (.*) $1?sub=%2&page=$1&domain=%{HTTP_HOST} [QSA,L]
<IfModule>

該代碼基本上會將子域、域和請求的頁面發(fā)送到請求的頁面.然后在 php 中你可以檢查它是否等于你的客戶端用戶名.并允許您同時(shí)為您的客戶使用托管域名.

that code basically will send to the requested page the subdomain, the domain and the page requested. then in php you can check if it is equal to your client username. and allow you also to use parked domains for your clients at the same time.

希望能幫到你.

這篇關(guān)于Symfony 動態(tài)子域的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

相關(guān)文檔推薦

Add programmatically a downloadable file to Woocommerce products(以編程方式將可下載文件添加到 Woocommerce 產(chǎn)品)
Get today#39;s total orders count for each product in Woocommerce(獲取今天 Woocommerce 中每種產(chǎn)品的總訂單數(shù))
Add Custom registration fields in WooCommerce and phone field validation issue(在 WooCommerce 和電話字段驗(yàn)證問題中添加自定義注冊字段)
Add a select field that will change price in Woocommerce simple products(在 Woocommerce 簡單產(chǎn)品中添加一個(gè)將更改價(jià)格的選擇字段)
Add custom columns to admin products list in WooCommerce 3(在 WooCommerce 3 中將自定義列添加到管理產(chǎn)品列表)
Customizing checkout quot;Place Orderquot; button output html(自定義結(jié)帳“下訂單按鈕輸出html)
主站蜘蛛池模板: 亚洲视频免费在线播放 | 久久久久国色av免费观看性色 | 成人在线中文字幕 | 欧美操操操 | 精品美女 | 精品久久精品 | 欧美日韩国产在线观看 | 久久国产精品免费一区二区三区 | av中文字幕在线播放 | 日韩视频精品在线 | 久久小视频 | 91一区二区三区 | 一级片网址 | 色婷婷国产精品 | av大片 | 中文天堂在线观看 | 91视频91| 日韩免费视频一区二区 | aaaa网站 | 免费av手机在线观看 | 国产美女久久 | 成人午夜精品 | 日日夜夜天天 | 国产欧美一区二区三区在线看 | 久久久国产一区 | 国产羞羞视频在线观看 | 欧美6一10sex性hd | 在线成人av | 91视频久久| 综合精品在线 | 在线免费看毛片 | 成年人在线观看 | 色必久久 | 一区二区三区成人 | 欧美综合国产精品久久丁香 | 一区二区久久 | 伊人网站在线观看 | 麻豆hd | 免费黄色av | 精品视频成人 | 日韩久草|