|
|
首先感谢IDCSPY热情的版主们,没有你们,我的站点没那么顺利搞好。
我8月15号买了个LP空间,并且在上面建立了BBS、uchome等数个站点,也同时在根目录下划分了几个文件夹来建站,因为没有要免费的域名,只把自己以前在用的绑到LP上,导致根目录下的文件夹无法用以前用的域名访问。这里和大家分享一下:
1、如何让主域名指向public_html下的子目录:
其实很简单,只需要一个.htaccess文件就可以解决:
编辑public_html目录下的.htaccess文件,加入如下语句.如果public_html下没有.htaccess文件,新建一个即可.
注意:将 yourmaindomain.com修改为你的域名,将subfolder修改为你要指向的public_html下的子目录.最后一行中的index.php修改为你的网站的主页名称.(修改粗体表示的内容,其他内容不要改动)
# www.host114.org
# .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/index.php [L]
2、独立IP可以更换:
我买空间的时候也买了独立IP,可那分配来的独立IP基本PING不通,只好用自己非常非常菜的英语和LP的客服沟通,在来回20多回合的对话后,更换了一个相对满意的独立IP给我。需要注意的是:我看有些兄弟和客服沟通还没有那么快回应,我想如果客气点,问题描述详细点,只要合理的要求,他们的回应速度都是比较快的,多说几句Thank you,绝对没错
3、等解决问题了再分享
4、谢谢CCTV、谢谢OG、谢谢IDCSPY.COM、谢谢DZ、谢谢LP、、、、 |
|