Domain name - How does Apache rewrite the access to the root directory to directly access a website under that directory?
滿天的星座
滿天的星座 2017-05-16 17:04:59
0
1
411

Assumption: I have deployed 3 websites under /var/www (i.e. 3 directories, a, b, c), and there is also an index.html
under /var/www Now the domain name example.com has been mapped to the server IP
When accessing directly through example.com, you will see index.html
example.com/a is visiting website a
example.com/b is accessing website b
example.com/c is accessing the c website

If I want to achieve this effect now:
example.com/b or example.com/b/xxxx is visiting website b
example.com/c or example.com/c/xxxx is visiting the c website
example.com is visiting a website

How to configure?

Thanks!

滿天的星座
滿天的星座

reply all(1)
我想大声告诉你

Can I use the rewrite function
Place a .htaccess file under example.com/b/xxxx and use regular expression matching in it
^b/xxxx/$ b/$1
Finally, in httpd.conf (/etc/httpd/conf/httpd.conf), change 'AllowOverride None' to 'AllowOverride All' (if necessary)

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!