|
|
9100K.com
发表于 2012-8-8 21:07:21
|
显示全部楼层
本帖最后由 9100K.com 于 2012-8-8 09:11 PM 编辑
[quote]kyxt 发表于 2012-8-8 03:46 PM
我用的是htaccess
代码如下 (从网上找的方法)
-----------------------------------------------------------------------------------------------
# Bluehost.com
# .htaccess main domain to subdirectory 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.
# Do not change this line.
RewriteEngine on
# Change yourdomain.com to be your main domain.
RewriteCond %{HTTP_HOST} ^(www.)?*****.com$
# Change 'subdirectory' to be the directory you will use for your main domain.
RewriteCond %{REQUEST_URI} !^/*****/
# Don't change this line.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Change 'subdirectory' to be the directory you will use for your main domain.
RewriteRule ^(.*)$ /*****/$1
# Change yourdomain.com to be your main domain again.
# Change 'subdirectory' to be the directory 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.)?*****com$
RewriteRule ^(/)?$ *****/index.php [L]
----------------------------------------------------------------------------------------------------
这样可以吗?
但是登陆之后有这样的一个问题
每次域名后面都显示子目录的名字 如[url]www.9100k.com/baidu(子目录名字)
怎么用rewrite呢? |
|