哪位高手帮小弟我发个.htaccess域名传向文件?为什么这个不行
谁帮我发个.htaccess域名传向文件?为什么这个不行?
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.xxx.com$ [OR]RewriteCond %{HTTP_HOST} ^xxx.com$
RewriteRule ^/?$ "http\:\/\/www\.example\.com" [R=301,L]
谁帮我发个.htaccess域名传向文件?为什么这个不行?
同时绑定在一个空间里的有五个域名1.www.example.com,2.www.xxx.com,3.xxx.com,4.bbs.example.com;5.news.example.com;
要实现的功能:
当用www.xxx.com,xxx.com来访问时,自动跳转至www.example.com(地址栏域名显示成www.example.com)指向空间主页面index.php。
当bbs.example.com来访问时,指向www.example.com/bbs 子页面;(地址栏域名显示成bbs.example.com)。
当news.example.com来访问时,指向www.example.com/news 子页面;(地址栏域名显示成news.example.com)。
------解决方案--------------------
域名跳转没试过。。。是不是你没开启.htaccess目录识别?
子页跳转的话可以用这个
RewriteCond %{HTTP_HOST} ^bbs.example.com$
RewriteCond %{REQUEST_URI} !^/bbs/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /bbs/$1
RewriteCond %{HTTP_HOST} ^bbs.example.com$
RewriteRule ^(/)?$bbs/index.php [L]
------解决方案--------------------
域名转向?是不是就是跳转呢?

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

To learn more about open source, please visit: 51CTO Hongmeng Developer Community https://ost.51cto.com Running environment DAYU200:4.0.10.16SDK: 4.0.10.15IDE: 4.0.600 1. To create an application, click File- >newFile->CreateProgect. Select template: [OpenHarmony] EmptyAbility: Fill in the project name, shici, application package name com.nut.shici, and application storage location XXX (no Chinese, special characters, or spaces). CompileSDK10, Model: Stage. Device

The usage of rewritecond can determine whether a certain rewrite rule should be applied based on specific conditions. The RewriteCond instruction supports a variety of conditions, including checking the source IP address of the HTTP request, checking the source domain name of the HTTP request, checking the User-Agent header of the HTTP request, checking the HTTP method of the request, checking the query string of the request, and checking the file type of the request. etc.

The difference between comcn and com: 1. There are differences between comcn and com in terms of meaning, but there is no difference in access speed; 2. comcn is an international domain name and is a global top-level domain name for use by commercial institutions, while cn is a Chinese company domain name , domestic commercial institutions, domestic domain names, only enterprises can register; 3. The search priority is that cn will search for .cn first. After finding the .cn server, the .cn server will then search for .com; 4. cn is provided by cnnic China Internet Center Management, com's management organization is abroad.

The full English name of BBS is "Bulletin Board System", and the Chinese name is "Electronic Bulletin Board System". In China, it is generally called an Internet forum. In its early days, it had the same nature as bulletin boards on the streets and on campus, except that it was used to spread or obtain information through computers. It was not until personal computers began to become popular that someone tried to transfer the BBS on Apple computers to personal computers, and BBS began to gradually become popular.

The full name of bbs is Bulletin Board System, which means "electronic bulletin board system" in Chinese. It generally refers to an online forum and is an online communication place related to network technology. Its characteristics: large amount of information, fast information update, and strong interactivity.

The full name of bbs is Bulletin Board System, which means "electronic bulletin board system" in Chinese. It generally refers to an online forum and is an online communication place related to network technology; BBS generally refers to an online forum or online community. The characteristics of BBS: large amount of information, fast information update, and strong interactivity.

In Linux, grep is a very common and important tool. It is a command that every professional operation and maintenance engineer must master, because it can quickly find and filter the contents of files. So how to use grep in Linux system? The following is Let’s take a look at the common usage introduction. 1. Basic usage The grep command is mainly used to search for lines of a specified pattern in files. For example, to find the line containing "example" in the file file.txt, you can use the grep command. grep 'example' file.txt grep will output all lines containing 'example'.

Usage and examples of the endfor keyword in PHP In PHP programming, the for loop is a commonly used control structure, which is used to repeatedly execute a block of code. The number of loops can be controlled by specifying the initial value, loop condition, and increment. In PHP, the endfor keyword is a special syntax used to end a for loop. In a general for loop, we often use braces ({}) to wrap the loop body, and then terminate the loop early by using the break keyword. However, PHP provides
