.htaccess เวลาเข้า xxx.com/abc/ ให้เปลี่ยนเป็น abc.xxx.com ครับ

เริ่มโดย theballkyo, 25 สิงหาคม 2012, 09:15:12

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

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

theballkyo

ใครพอมี code มั่งครับ

เวลาเข้าเว็บ xxx.com/abc/ ให้เปลี่ยน url เป็น abc.xxx.com

คือผมใช้ directadmin สร้าง subdomain ไว้

แต่มันสามารถเข้าได้ xxx.com/abc/ ครับ

เลยอยากให้มันเปลี่ยนเป็น abc.xxx.com เวลาเข้าทาง xxx.com/abc/

งมหาใน google ไม่เจอเลยครับ  :wanwan017:
[direct=https://mc-sv1.enjoyprice.in.th]เล่นฟรี เซิฟเวอร์ Minecraft 1.8.8[/direct]
[direct=https://blog.ezdev.me]blog.ezdev.me เขียนโปรแกรมไม่ใช้เรื่องยาก[/direct]
รับทำเว็บไซต์ PHP ราคากันเองติดต่อได้ที่ theballkyo[at]gmail.com

gigkokman

น่าจะเซต wildcard (*) ที่โดเมนหลักแล้วเช็คโดเมนรึป่าวครับ

รอผู้รู้อีกทีครับ
:wanwan019:
ลิขิตฟ้าหรือจะสู้มานะคน

gootum


Unlocker

ไม่แน่ใจว่าจะเวิร์กมั้ย ลองดูนะครับ

RewriteEngine On
RewriteRule ^www.xxx.com/abc/(.*)$ http://abc.xxx.com/$1 [R=301,L]
[direct=https://drive9x.com]FREE! ระบบ Google Drive Proxy ที่เจ๋งที่สุด[/direct]
hostalternative [direct=https://www.hostalternative.com]vpsสำหรับเว็บสายโหดสายดาร์ก คนเข้าเกิน100k จูนให้ฟรี ลื่นหัวแตก[/direct]
รับจูน VPS/Server ประสบการณ์10ปี+

ioffer30


dannie

ขอถามแทรกนะครับ ถ้าไม่มีไฟล์ .htaccess จะสร้างเอาไปไว้ยังไงครับ เคยทำแล้วแ่ต่เว็บไม่อ่าน eror ไปเลยครับ   :wanwan044:

iSEOmen


obi001

Options +FollowSymlinks
RewriteEngine on
rewriterule ^(.*)$ $1.domain.com/ [R=301,L]

ผมมั่วเอานะ ไม่ได้ test


ไม่ก้อลอง
RewriteEngine On
RewriteRule ^www.xxx.com/abc/ hxxp://abc.xxx.com/[R=301,L]

copy มาจาก คุณข้างบน
ขอให้เงินทองจงอยุ่กับท่าน

WPDSign

สร้างบ้าน Modern [direct=https://casa-concept1.com/]แบบบ้านโมเดิร์น[/direct] มาแรง
» ต้องการสร้างบ้านดูแบบบ้านสวยๆ [direct=http://www.architect-bkk.com/แบบบ้านสองชั้น]แบบบ้านสองชั้น[/direct] ทุกสไลต์บริการ[direct=http://www.ideaican.com/]รับสร้างบ้าน[/direct] ใครฝันอย่างสร้างบ้านสไตล์รีสอร์ท มี[direct=https://แบบบ้านสไตล์รีสอร์ท.blogspot.com]แบบบ้านสไตล์รีสอร์ท[/direct]พร้อมก่อสร้าง ลงประกาศขายบ้านที่ [direct=http://www.classified108.com/]ลงประกาศ[/direct]


theballkyo

[direct=https://mc-sv1.enjoyprice.in.th]เล่นฟรี เซิฟเวอร์ Minecraft 1.8.8[/direct]
[direct=https://blog.ezdev.me]blog.ezdev.me เขียนโปรแกรมไม่ใช้เรื่องยาก[/direct]
รับทำเว็บไซต์ PHP ราคากันเองติดต่อได้ที่ theballkyo[at]gmail.com

imagineverend

ยังไม่เคยลอง
ได้เทคนิค เพิ่มอีก ขอบคุณที่แชร์กันครับ

xvlnw.com

อ้างถึงจาก: Unlocker ใน 25 สิงหาคม 2012, 13:02:11
ไม่แน่ใจว่าจะเวิร์กมั้ย ลองดูนะครับ

RewriteEngine On
RewriteRule ^www.xxx.com/abc/(.*)$ http://abc.xxx.com/$1 [R=301,L]


ตามนี้ครับ น่าจะได้ครับ
[direct=https://cloudhost.in.th/wordpress-hosting]ツ ⓌⓄⓇⒹⓅⓇⒺⓈⓈ ⒽⓄⓈⓉⒾⓃⒼ [/direct] :wanwan014:  :D
[direct=https://cloudhost.in.th/cloudhosting.html]Cloud Hosting[/direct] [direct=https://cloudhost.in.th/cloudvps.html]Cloud Server[/direct] [direct=https://cloudhost.in.th/vpshosting.html]Cloud VPS Hosting[/direct] [direct=https://cloudhost.in.th/windowsvps.html]Cloud Windows[/direct] Tel: 080-348-0843 LINE: ixvlnw

obi001

ผม save มาจาก ใครสักคนในบอร์ด เจอมาพอดี

Options +FollowSymLinks
Order deny,allow
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} ^(.+)$
RewriteRule ^(.*)$ hxxp://%1.example.com [R=301,L]



=============================
RewriteEngine on
# เปลี่ยนให้เป็นชื่อ yourdomain.com
RewriteCond %{HTTP_HOST} ^(www.)?yourdomain.com$
# ระบุ subfolder ใหม่ที่ต้องการ redirect ไป กรณี นี้สร้า sub folder ใหม่ขึ้นมาชื่อ /yourdomain.com/
RewriteCond %{REQUEST_URI} !^/yourdomain.com/
# Don't change this line.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# ระบุ subfolder ใหม่ที่ต้องการ redirect ไป
RewriteRule ^(.*)$ /yourdomain.com/$1
# เปลี่ยนให้เป็นชื่อ yourdomain.com อีกครั้ง
RewriteCond %{HTTP_HOST} ^(www.)?yourdomain.com$
#ระบุไฟล์หลักของ domain
RewriteRule ^(/)?$ yourdomain.com/index.php [L]
ขอให้เงินทองจงอยุ่กับท่าน