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



บทความ


Page Ranking Tool

Success mapping multiple domains to different folders with htaccess


สอน SEO
> Success mapping multiple domains to different folders with htaccess


Hello everyone, I successfully been able to map two defferent domains to two different subfolders with htaccess, without redirections or subdomains, and in the url will appear only the domain and not the subfolder. The HTTP Status code is 200 which is OK so I think will not affect Bot indexing negatively. I know there are other ways to have multiple blogs but as crazy as it may sound for the time been I want to have a per folder wordpress installation. Nevertheless I would like to get some opinions about security issues with this htaccess file or anything I may have overlooked, and I really hope someone find some good use of it.

To use it create a .htaccess file with any text editor, under windows create a file named htaccess and renamed it later in the server by adding the '.' character in front of it. Copy the following contents replacing domain_1.com, domain_2.com, folder_1 and folder_2 with what you need, and finally place the file at the root of your server. That's all, I hope I didn't miss a thing.




  Code
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

# ---------------------------------------
# BEGIN Domain to folder mapping

# pointing domain_1.com to folder_1
ReWriteCond %{HTTP_HOST} domain_1.com
ReWriteCond %{REQUEST_URI} !folder_1/
ReWriteRule ^(.*)$ folder_1/$1 [L]

# pointing domain_2.com to folder_2
ReWriteCond %{HTTP_HOST} domain_2.com
ReWriteCond %{REQUEST_URI} !folder_2/
ReWriteRule ^(.*)$ folder_2/$1 [L]

# END Domain to folder mapping
# ---------------------------------------

# ---------------------------------------
# BEGIN WordPress

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress
# ---------------------------------------

# ---------------------------------------
# BEGIN htaccess pretection

<Files .htaccess>
order allow,deny
deny from all
</Files>

# END htaccess pretection
# ---------------------------------------

</IfModule>




refer: http://wordpress.org/support/topic/success-mapping-multiple-domains-to-different-folders-with-htaccess

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

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