122.155.xx.xxx/~username/ ให้เป็นเว็บจริง

เริ่มโดย hackz, 12 ตุลาคม 2014, 11:17:18

หัวข้อก่อนหน้า - หัวข้อถัดไป

0 สมาชิก และ 1 ผู้มาเยือน กำลังดูหัวข้อนี้

hackz

สวัสดีค่ะ อยากจะทราบว่า เมื่อมีสมาชิกเข้าเว็บของเราผ่านไอพี ด้วยลิงก์นี้ เช่น

http://122.155.xx.xxx/~username/
http://122.155.xx.xxx/~username/archiver/?tid-12369.html


อยากให้ระบบมัน Redirect ไปยังเว็บจริงของเราเลย คือ

http://xx.com
http://xx.com/archiver/?tid-12369.html


จะมีวิธีการทำอย่างไรดีคะ

ใช้ htaccess เข้าช่วยได้ไหมค่ะ

ตอนนี้ ลิงก์ดังกล่าว มันติด Index ของ Google ไปแล้วด้วย

รบกวนทุกท่านด้วยนะคะ

smapan

#1
Redirect 301 http://122.155.xx.xxx/~username/ http://xx.com
[direct=http://cp.siamhostweb.com/cart.php?gid=1]จูมล่าโฮส สยามโฮสเว็บ[/direct] [direct=http://www.modty.com]modty.com[/direct]
[direct=http://www.apartment.in.th]รวมที่พัก เช่ารายวัน ที่พักเช่ารายเดือนมากที่สุดแจ่มจริง[/direct]
***Tel 083-757-1515 ติดปัญหา Joomla ตรงไหนรับปรึกษาฟรี โทรมาเถอะครับ ถ้าตอบได้ช่วยแน่นอน ไม่มีกั้ก. ***

CastieL

#2
RewriteCond %{HTTP_HOST} ^122.155.xx.xxx/~username/$ [NC,OR]
RewriteRule ^(.+)$ http://xx.com/$1 [R=301,L]


ลองอันนี้ดูนะครับ

แบบนี้เวลาคนเข้าจาก url อะไรก็ตามที่ขึ้นต้นด้วย 122.155.xx.xxx/~username/
จะถูกเปลี่ยนมาเป็น http://xx.com/
เช่น 122.155.xx.xxx/~username/content.html --> http://xx.com/content.html

ผมไม่ค่อยเป๊ะเรื่อง syntax เช็คดูอีกทีนะครับ

icez

RewriteEngine On
RewriteBase /

RewriteCond %{HTTP_HOST} !xx.com
RewriteRule "^~username/(.*)$" http://xx.com/$1 [R=301]
[direct=http://www.thzhost.com/]THZHost[/direct] SSD Hosting ไทย/สิงคโปร์ พร้อม firewall ป้องกันการยิงเว็บ + scan ไวรัสในเว็บ