Table of Contents
回复讨论(解决方案)
Home Backend Development PHP Tutorial 关于网站导航二级域名的问题,纠结很久了

关于网站导航二级域名的问题,纠结很久了

Jun 23, 2016 pm 01:56 PM
secondary domain navigation website

有个问题一直纠结了很久了,一个网站,比如说导航有 动作 喜剧 科幻

对应的是二级域名,我就用我的站来举例,不是广告,

动作现在是:http://www.cuangs.com/Dongzuopian/           应该对应   http://Dongzuopian.cuangs.com 

喜剧现在是:http://www.cuangs.com/Xijupian/                  应该对应   http://Xijupian.cuangs.com

科幻现在是:http://www.cuangs.com/Kehuanpian/            应该对应    http://Kehuanpian.cuangs.com

后面肯定还有很多的比如爱情,悬疑等。

我是不是每一个二级都要去对应的绑定呢,写到这里我都有点晕糊了,就是二级的应该是怎么操作的呢?在线等。


回复讨论(解决方案)

貌似用URL重写就行了。

你的网站 http://www.cuangs.com 并不支持二级域名
请与域名供应商联系开启二级域名解析

你的网站 http://www.cuangs.com 并不支持二级域名
请与域名供应商联系开启二级域名解析


支持哦,我的是VPS,上面有使用过二级的其他站

学习学习

做过类似的,很多地区分站
如果是独立主机不用麻烦,二级域名直接指向根目录,虚拟主机不能省吧
在程序入口获取某个系统变量,加进$_GET,rewrite倒不用

二级域名的控制在于DNS服务商,不在vps供应商,除非两个是同一家
二级域名分主机和跳转两种方式,你这个属于跳转;跳转也分显式和非显式,视乎DNS服务商是否提供,貌似国内不少DNS服务商都不支持显式跳转
上面的东西又不明白去wiki一下

如果支持的话,http://dongzuopian.cuangs.com 就应该访问到(哪怕是错误的页面)而不是提示域名错误

泛解析。这个还真没搞过,原先做的是Win IIS 直接一个个手动绑定,那个麻烦啊,linux下不知道是如何操作。

其实没啥神秘的,三步搞定
1域名做一下泛解析就是  *.域名  然后单独绑定一个主机头的站点
2通过用户的 $_SERVER[''HTTP_HOST'] 获取当前访问的域名
3根据当前访问的域名获取到用户名,再获取其他信息。

嗯,泛解析是可以,还有根据$_SERVER[''HTTP_HOST'] 这个一起结合也可以,谢谢大家,搞掂。

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Is there any website for learning C language? Is there any website for learning C language? Jan 30, 2024 pm 02:38 PM

Websites for learning C language: 1. C Language Chinese Website; 2. Rookie Tutorial; 3. C Language Forum; 4. C Language Empire; 5. Script House; 6. Tianji.com; 7. Red and Black Alliance; 8, 51 Self-study network; 9. Likou; 10. C Programming. Detailed introduction: 1. C language Chinese website, which is a website dedicated to providing C language learning materials for beginners. It is rich in content, including basic grammar, pointers, arrays, functions, structures and other modules; 2. Rookie tutorials, This is a comprehensive programming learning website and more.

How to open a website using Task Scheduler How to open a website using Task Scheduler Oct 02, 2023 pm 11:13 PM

Do you frequently visit the same website at about the same time every day? This can lead to spending a lot of time with multiple browser tabs open and cluttering the browser while performing daily tasks. Well, how about opening it without having to launch the browser manually? It's very simple and doesn't require you to download any third-party apps, as shown below. How do I set up Task Scheduler to open a website? Press the key, type Task Scheduler in the search box, and then click Open. Windows On the right sidebar, click on the Create Basic Task option. In the Name field, enter the name of the website you want to open and click Next. Next, under Triggers, click Time Frequency and click Next. Select how long you want the event to repeat and click Next. Select enable

How to convert your website into a standalone Mac app How to convert your website into a standalone Mac app Oct 12, 2023 pm 11:17 PM

In macOS Sonoma and Safari 17, you can turn websites into "web apps," which can sit in your Mac's dock and be accessed like any other app without opening a browser. Read on to learn how it works. Thanks to a new option in Apple's Safari browser, it's now possible to turn any website on the internet you frequently visit into a standalone "web app" that lives in your Mac's dock and is ready for you to access at any time. The web app works with Mission Control and Stage Manager like any app, and can also be opened via Launchpad or SpotlightSearch. How to turn any website into

Amap launches upgraded version of driving ETA service: real-time analysis of current road conditions and more accurate estimated arrival time Amap launches upgraded version of driving ETA service: real-time analysis of current road conditions and more accurate estimated arrival time Apr 30, 2024 am 08:37 AM

According to news from this site on April 29, Amap officially announced the launch of an upgraded version of driving ETA (Note from this site: ETA is the estimated time of arrival, which refers to the estimated time it will take for the user to depart from the current moment and follow a given route to the destination. ) service, which aims to help users make more accurate route planning duration and traffic condition estimates, and assist users in making travel decisions. This map application is the latest upgraded Amap App. It introduces the "ultra-large-scale graph convolutional neural network model", which can better capture and learn traffic flow patterns, support urban road networks and highway systems, and can Accurately depict the spatiotemporal dynamic changes of traffic conditions. In addition, the new version of the map further integrates the iTransformer time series prediction model to support real-time analysis.

How to check dead links on your website How to check dead links on your website Oct 30, 2023 am 09:26 AM

Methods to check dead links on a website include using online link tools, using webmaster tools, using robots.txt files, and using browser developer tools. Detailed introduction: 1. Use online link tools. There are many online dead link detection tools, such as LinkDeath, LinkDefender and Xenu. These tools can automatically detect dead links in the website; 2. Use webmaster tools. Most webmasters Tools, such as Google's Webmaster Tools, Baidu's Webmaster Tools, etc., all provide dead link detection functions and so on.

How to implement page jump and navigation in uniapp How to implement page jump and navigation in uniapp Oct 20, 2023 pm 02:07 PM

How to implement page jumps and navigation in uniapp. uniapp is a front-end framework that supports one-time coding and multi-end publishing. It is based on Vue.js. Developers can use uniapp to quickly develop mobile applications. In uniapp, implementing page jumps and navigation is a very common requirement. This article will introduce how to implement page jump and navigation in uniapp, and provide specific code examples. 1. Page jump Use the methods provided by uniapp to jump the page. uniapp provides a set of methods for implementation.

Free second-level domain name application process Free second-level domain name application process Jan 23, 2024 am 11:09 AM

Application steps: 1. Enter the domain name registration service website, register an account and log in; 2. Select the "Domain Name Registration" service, enter the second-level domain name you want to register, and click Query; 3. If the second-level domain name has not been registered, then You can click the "Register Now" button to register; 4. On the registration information page, fill in the domain name owner's name, contact number, email and other information, and set a password; 5. Confirm the payment method and complete the payment; 6. Wait for the official Review generally takes 1-5 working days.

How to implement image browsing and thumbnail navigation through Vue? How to implement image browsing and thumbnail navigation through Vue? Aug 18, 2023 pm 02:51 PM

How to implement image browsing and thumbnail navigation through Vue? With the development of web applications, pictures play an increasingly important role in our daily lives. In many cases, we need to implement image browsing and thumbnail navigation functions. This article will introduce how to use the Vue framework to implement this function and provide code examples. In Vue, we can use the Vue plug-in to implement image browsing and thumbnail navigation functions. A popular plugin is vue-gallery, which provides a simple and easy-to-use interface

See all articles