Home > Backend Development > PHP Tutorial > Solution to 403 error when phpStudy configures multi-site and multi-domain names

Solution to 403 error when phpStudy configures multi-site and multi-domain names

黄舟
Release: 2023-03-16 17:46:01
Original
3774 people have browsed it

This article mainly introduces the method of phpStudy configuring multi-site and multi-domain names and the solutions to 403 errors encountered. Friends in need can refer to it

This article is not suitable for those who do not understand multi-site and multi-domain names. . It is suitable for you to solve the problem with just one point. OK. More casual.

First, open the site domain name management. The configuration is as follows. You can set the website domain name and directory yourself. Reset the port to one other than 80. Then add it first and then save it.

Open the configuration file vhosts, and you will see the addition of port 801

In the configuration file http. conf, add a new port number after 80

and then configure it in the hosts file, 127.0.0.1 www.aaa.com

Then again, Mader GG, forbidden appears, 403, no access rights.

After a lot of effort, I finally found the solution. I will copy the content of the solution first, and finally attach the address of the original text.

Step 1

Add it under the hosts file under C:\Windows\System32\drivers\etc (do not add the # sign in front, it is a comment)

The second step is to find the httpd.conf file under Apache, open it, and remove the

in front of line 171.

#The third step is to configure the following content in the apache configuration file vhosts.conf

Restart Apache

. . . . The domain name is assigned. . There is another problem at this time

#The browser displays a page like this, but when you enter www.test.com/index.php, you can access the index.php program. Write the full path. . . . How to break. . . Comment out the 18 lines in the third step or put + (plus sign) in front of the two words after options. Then restart Apache and you can directly access www.test.com. This problem will be solved! ! ! ! At this time, there is another problem. When you directly access the folders in index.php, you can't see anything. . . I skipped it directly, so what’s the matter? No problem, just go through and visit. At this time, open httpd.conf, comment out line 251, and the problem is solved (sometimes you don’t need to comment out, it depends on your own situation) It seems that static websites need comments, but dynamic websites do not need comments

Add another sentence and bring the port when visiting, such as: http://www.aaa.com:801/

Summary

The above is the detailed content of Solution to 403 error when phpStudy configures multi-site and multi-domain names. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template