Ourservicedomain name Hostingdomain nameDomain Namegoogle apps serviceGoogle Appsgoogle apps serviceCMSgoogle apps serviceResellergoogle apps serviceHow to Order/Paymentgoogle apps serviceคู่มือการใช้งานgoogle apps service google apps service  Sitemap
home customer support
home hosting order services support contacts
คุณอยู่ที่หน้า : ศูนย์บริการลูกค้า > บทความและคู่มือการใช้งาน > DirectAdmin ControlPanal > การตั้งค่า Site Redirection / Site Forwarding





Our Partner

General Information

free hit counters

Page Ranking Tool

traceroute

การตั้งค่า Site Redirection / Site Forwarding

คู่มือการใช้งาน DirectiAdmin ระบบจัดการเว็บไซต์
>> การตั้งค่า Site Redirection

เข้าสู่ระบบจัดการเว็บไซต์
เลือกเมนู >
Site Redirection

เป็นการตั้งค่า เมื่อมีผู้ใดเรียกเข้าเว็บ โดยทำการพิมพ์โฟลเดอร์ หรือไฟล์ที่กำหนด
ระบบจะทำการ Redirect ไปยังหน้าเว็บที่ต้องการ เช่น

เมื่อมีผู้เรียก url เป็น http://domain.com/index.php
ระบบจะส่งต่อผู้ที่เข้ามาไปยัง http://domain.com/index2.php เป็นต้น

โดยสามารถตั้งค่า ได้ทั้ง โฟลเดอร์และไฟล์

วิธีการตั้งค่าใช้งาน

Add New Redirect
Local URL Path thaihostwork.com eg: /redirect    or: /
Redirect Type
Destination URL eg: http://www.redirected.com


Local URL Path คือ โฟลเดอร์หรือไฟล์ที่กำหนด ให้กระทำ เมื่อมีการเรียกใช้ เช่น
thaihostwork.com/th หรือ http://thaihostwork.com/index.php

Redirect Type คือรูปแบบที่กระทำ มีสามรูปแบบคือ
301 - Permanent
302 - Temporary
303 - Replaced

ให้สมาชิกเลือก Replaced คือ เมื่อทำการเรียก URL ใดๆ ที่เลือก ให้ทำการเปลี่ยนไปยัง URL เป้าหมาย


นอกจากนี้ เรายังสามารถทำการ ตั้งค่า ด้วยมือเราในการ Redirect เว็บตามต้องการ
ด้วยการเขียน Code ต่างๆ
ดังต่อไปนี้ครับ


กรณีที่ 1 การใช้ Meta Tags ในการ Redirect หน้าเว็บที่ต้องการ
ความหมายก็คือ เป็นการกำหนดให้ทำการเปิดเว็บเพจที่มี URLhttp://www.thaihostwork.com/contacts.php  ภายใน 3 วินาทีหลังจากที่แสดงเว็บเพจปัจจุบันเสร็จเรียบร้อยแล้ว เราสามารถกำหนดให้บราวเซอร์ทำการเปิดเว็บเพจใหม่ได้ทันทีโดยการกำหนดให้เป็น ตัวเลขวินาทีเป็น 0 ตัวอย่างข้างล่างนี้คือตัวอย่างที่ใช้งานได้จริง


เช่น


กรณีที่ 2 การ Re-direct โดยใช้ PHP
ใน PHP มีคำสั่งที่ใช้ในการส่ง HTTP header คือ คำสั่ง header มีรูปแบบคือ
void header ( string string [, bool replace [, int http_response_code]])

การ Re-direct โดยใช้ PHP สามารถทำได้ 2 แบบคือ
1. ทำการ Re-direct ไปยังเว็บไซต์ใหม่ทันทีโดยใช้ location header มีรูปแบบคือ
                    header("location:http://www.thaihostwork.com/newpage/");
        ?>

2. ทำการ Re-direct ทันทีโดยใช้ refresh header มีรูปแบบคือ
ตัวอย่างนี้แสดงให้เห็นว่าเราสามารถทำการ Re-direct ไปยังเว็บเพจใหม่ได้โดยการกำหนดให้เวลามีค่าเป็น 0 วินาที
                      header( ''refresh: 0; url=http://www.thaihostwork.com/newpage/'' );
         ?>

นอกจากนี้ยังสามารถเขียน url สั้นๆ ได้หากเป็นการ Re-direct ไปที่เว็บเซิร์ฟเวอร์เดียวกัน
                       header( ''refresh: 5; url=/webdsn/'' );
         ?>
หรือ
                     header( ''refresh: 3; url=/'' );
         ?>

ข้อควรระวังก็คือการใช้คำสั่ง header() นี้จะต้องถูกเรียกใช้ก่อนที่จะมีการส่งค่าอื่นๆ เพื่อให้บราวเซอร์แสดงผล คุณจะไม่สามารถนำ HTML tags บรรทัดว่างๆ หรือแม้แต่กระทั่งช่องว่างเพียง 1 ช่องแทรกไว้ก่อนคำสั่งนี้ หรือต้องวางไว้บรรทัดบนสุด นั้นเอง


กรณีที่ 3 การกำหนดค่า ด้วย ไฟล์ .htaccess ง่ายๆ โดย
ทำการสร้างไฟล์ ชื่อ .htaccess ไว้ใีน public_html ของพื้นที่ของเว็บสมาชิก

เขียนข้อมูลกำหนดค่ารูปแบบดังนี้
                (รหัส)     (url path ที่กำหนด)                 (ลิงค์ปลายทาง)
Redirect 303       /index.php                               /contact.php
Redirect 303       /index.php                               http://www.thaihostwork.com

เช่น
Redirect 303 /customer http://www.thaihostwork.com/customer.php
Redirect 303 /domain_price http://www.thaihostwork.com/domain_price.php
Redirect 303 /contact http://www.thaihostwork.com/ticket.php
Redirect 303 /ticket http://www.thaihostwork.com/ticket.php

เพียงแค่นี้เราก็ตั้งค่า Site Forwarding หรือ Redirect URL ได้ตามต้องการแล้วครับ



บทความนี้เป็นประโยชน์หรือไม่?

เพิ่มเข้ารายการโปรด เพิ่มเข้ารายการโปรด

พิมพ์บทความนี้ พิมพ์บทความนี้

การใช้งาน DirectAdmin ControlPanel (จำนวนผู้เข้าชม: 390)
ทดลองใ้ช้งาน Direct Admin (จำนวนผู้เข้าชม: 217)

Homeweb hosting google appsHostinghosting google appsOrder onlinegoogle apps serviceServicesgoogle apps mailSupportgoogle appsContacts

© 2009 ThaiHostUnlimited.com. All Rights Reserved.google apps servicelive chatEmail : support@thaihostunlimited.com
 
Popular Tags: Thai Host Unlimited,Unlimited Web Hosting, Unlimited Bandwidth,Unlimited Domain Hosting ,Unlimited Hosting  
ThaiHostUnlimited.com : Provider Host Unlimited,Unlimited Web Hosting,Unlimited Bandwidth,Unlimited Domain Hosting,Unlimited Hosting  
เลขที่จดทะเบียนพาณิชย์ 3419900580657  Bookmark and Share
ภาษา: