รับทำเว็บไซต์ครบวงจร
เลือกภาษา Thai English     facebook
รายการหลัก



บทความ


Page Ranking Tool

The .htaccess file for hosting multiple domains


สอน SEO
> The .htaccess file for hosting multiple domains


Our hosting service (Powweb) can host multiple domains or subdomains. There is a tool kit to cause it to happen or manage it, but it costs a little bit of money. If you don't need the extra domain name included in the tool kit, it can be done easily by adding a .htaccess file under the htdocs folder. Powweb uses the Apache server, so I guess everyone has such a folder.
When you have two domains to host, create two folders to hold the content of the web sites. E.g. if you have two domain names such as 'domainA.com' and 'domainB.com', then you create folders like 'domainA' and 'domainB'. Of course, inside these folders, you need at least an 'index.html' file. THEN
Use notepack to create a file called htaccess.txt and add the following lines


  Code
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !^/domainA/
RewriteCond %{HTTP_HOST} ^(www.)?domainA.
RewriteRule ^(.*)$ domainA/$1 [L]

RewriteCond %{REQUEST_URI} !^/domainB/
RewriteCond %{HTTP_HOST} ^(www.)?domainB.
RewriteRule ^(.*)$ domainB/$1 [L]



Use FTP to deposit the file under the 'htdocs' folder, which now also has the domainA and domainB folders. Rename the file htaccess.txt as .htaccess

That is it! COPY and paste the content, it is easy to get typing mistakes.
Note: Line 1 and Line2 of the .htaccess file askes to redirect request to specific folders for specific URL asked.
Line 3 gives the folders to be directed to, i.e. domainA
Line 4 gives the name of the web page to be pointed to the folder given in Line 3
Line 5 is some rule, you don't need to know too much, if you want, visit Apache server and search for it. I forget!

The other lines are just a repeat for the second domain.
You can create another set for a third domain, but you need to add another folder to hold the content, at least the index.html file.

This works for me and save some money. The tool kit, as I was told, is annual charge!

====================

This information was posted in several threads and a Read Me in this forum. But we know that many people often read recent posts first.

Quote:
Use notepack to create a file called htaccess.txt and add the following lines
Use Notepad or another plain text editor to copy and paste the code, then edit it. Save as ".htaccess" using the quotes or save as htaccess.txt, then rename after uploading the file to the htdocs folder. Just wanted to clarify this.

Be sure that you check to see if there is an existing .htaccess file in the htdocs folder BEFORE you upload anything. If there is one, download it. Make a copy to edit and keep the original. If you mess up this file, you may make your site inaccessible.


refer: https://forums.powweb.com/showthread.php?t=73109

Short URL click!
<< กลับคืน : เข้าชม 1,980 ครั้ง : ขึ้นไปด้านบน

รับทำเว็บไซต์ รับสร้างเว็บไซต์ รับออกแบบเว็บ รับเขียนเว็บ รับสอนทำเว็บ รับเช่า hosting รับเช่าพื้นที่เว็บไซต์ จดชื่อเว็บ รับโปรโมทเว็บไซต์ รับดูแลเว็บ SiteMap
สปริงเกอร์http://www.xn--22c2c4blb9n.xn--o3cw4h/