网络营销电子商务研究中心  
How to buy the best prescription safety glasses in Canada? Let's study!
Go Back   网络营销电子商务研究中心 > 网站建设 > Blog(博客)/Wiki(维客)/RSS/Cms
User Name
Password
 
FAQ Members List Calendar Cheap Glasses

Blog(博客)/Wiki(维客)/RSS/Cms Blog(博客)/、Wiki(维客)、RSS、Cms等WEB 2.0相关技术讨论专区。

Reply
 
Thread Tools Display Modes
  #1   IP: 82.116.154.18
Old 2009-01-11, 09:50 PM
topvip topvip is offline
超级版主
 
Join Date: 2006-01-04
Posts: 1206
topvip 正向着好的方向发展
Default 利用.htaccess绑定域名到子目录 - 同一空间安装多个wordpress[亲历]

发现一个很好的方法,.htaccess写法如下:
根目录的.htaccess如下:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^((www|blog)\.)?anysns\.com$
RewriteCond %{REQUEST_URI} !^/blog/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /blog/$1
RewriteCond %{HTTP_HOST} ^((www|blog)\.)?anysns\.com$
RewriteRule ^(/)?$ blog/index.php [L]
RewriteCond %{HTTP_HOST} ^(www\.)?csslog\.com\.cn$
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>

我要绑定的是把anysns.com绑定到blog目录中,所以不仅要在根目录放置.htaccess文件,还要在blog目录中放置.htaccess文件,blog目录中的.htaccess写法如下:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On RewriteBase /wordpress
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</IfModule>
# END WordPress

OK,做完上面的就OK啦,主要在本地写.htaccess并命名是不可能的,可以先保存为1.htaccess类似的名字,传到服务器上在修改成为.htaccess,安全起见还有设置属性为644,
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off

Forum Jump

Prescription-glasses.com offers prescription glasses online at discount prices.
All times are GMT +8. The time now is 10:57 AM.


Powered by vBulletin Version 3.8.7
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.