. htaccess domain name rewriting issues?
For example, the same support PHP space and binding there are 2 domain names www.aaa.com and www.bbb.com;
If the space contains at least the following files and directories (folders):
(Note: The directory or file under the root directory may have the same file name as the BBB, but the content is not necessarily the same. All cannot be shared)
index.php
Text/about.html
Tp/logo.jpg
aaa.php
Error.html
Robots.txt
When accessed with the start of a aaa.com or www.aaa.com domain name, it behaves as a normal access form
(without rewriting, direct access to the directory or file, home page, in the root directory of the space), such as:
http://www.aaa.com or when accessed with http://aaa.com, point to the index.php page,
If you also have direct access to the files in the corresponding folder under the root directory,
For example, http://www.aaa.com/text/about.html is also the direct access to the root directory under the Text folder about.html page,
Click the page on the page link is also normal;
When accessed with the start of the bbb.com domain name, all overrides (points) to the directory or file under the BBB folder in the root directory, for example:
When accessed with http://www.bbb.com or http://bbb.com, the address bar is displayed as http://www.bbb.com (the domain name is displayed unchanged) but the actual access is bbb/index.php page;
When accessed in the form of a similar http://www.bbb.com/directory/directory/file name, rewrite (point to) the directory or file under the BBB folder of the root directory;
Like what:
When the http://www.bbb.com/bbb.php address bar is displayed as http://www.bbb.com/bbb.php (the domain name is displayed unchanged) but the actual access is http://www.bbb.com/bbb/bbb.php page;
When the http://www.bbb.com/text/about.html address bar is displayed as http://www.bbb.com/text/about.html (the domain name is displayed unchanged) but the actual access is http://www.bbb.com/ bbb/text/about.html page;
The analogy;
Links and addresses on the page are also normal, and are the corresponding pages or files in the BBB directory;
It is best to jump to the corresponding error.html page when there is no corresponding page;
For example, when using http://www.bbb.com/aaa.php because the rewrite to the bbb/folder does not have aaa.php file (although the root directory has this file), which will jump to the bbb/error.html page??
What you learn to write or copy online is always a problem.
I hope you pass the Expert advice!!!
------Solution--------------------
You say a lot of things you don't know what you want
What URL do you want to turn into?
------Solution--------------------
Create a. htaccess file under the BBB folder
Rewriteengine on
Rewriterule ^bbb/bbb.php$ bbb.php
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service