Chinaunix首页 | 论坛 | 博客
  • 博客访问: 670716
  • 博文数量: 52
  • 博客积分: 7065
  • 博客等级: 少将
  • 技术积分: 2361
  • 用 户 组: 普通用户
  • 注册时间: 2004-10-03 16:24
文章分类

全部博文(52)

文章存档

2021年(8)

2019年(2)

2018年(14)

2011年(1)

2010年(3)

2009年(4)

2008年(20)

分类: LINUX

2008-08-21 12:52:25

 

# .htaccess main domain to subfolder redirect
# Copy and paste the following code into the .htaccess file
# in the public_html folder of your hosting account
# make the changes to the file according to the instructions.

RewriteEngine on
# Change yourdomain.com to be your main domain.

RewriteCond %{HTTP_HOST} ^(www.)?yourmaindomain.com$

# Change 'subfolder' to be the folder you will use for your main domain.

RewriteCond %{REQUEST_URI} !^/subfolder/

# Don't change this line.

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

# Change 'subfolder' to be the folder you will use for your main domain.

RewriteRule ^(.*)$ /subfolder/$1

# Change yourdomain.com to be your main domain again.

# Change 'subfolder' to be the folder you will use for your main domain

# followed by / then the main file for your site, index.php, index.html, etc.

RewriteCond %{HTTP_HOST} ^(www.)?yourmaindomain.com$

RewriteRule ^(/)?$ subfolder/ [L]

阅读(2234) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~