Ubuntu top-level domain names direct to second-level domain names

Source: Internet
Author: User

The www.a.com website is OK and a.com is required to be opened.

I checked some information and modified the. htaccess file. However, for efficiency, we decided to use the 301 permanent jump method.

First, create the text file a.com in the/etc/apach2/sites-available Directory (which can be any name) as follows:

<Virtualhost *: 80> servername A. comredirectmatch permanent ^/(. *) http://www.a.com/#1 </virtualhost>


Run

A2ensite a.com/etc/init.d/apache2 reload


It should be said that it is OK, but the test fails, but no problem is found?

No matter how it works. Restart Apache to check whether it is executed.

/Etc/init. d/apache2 restart

This test is OK. Why? It's not very clear. It's probably the difference between restart and reload. Ubuntu version: 10.04

The above is for your reference!

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.