dougu5847 2013-07-31 05:55
浏览 40

通过共享主机面板中的htaccess从文件夹创建虚拟子域

I want to do access www.domain.com/test as test.doamin.com and many more like test2.domain.com,test3.. by creating virtual subdomain through htaccess. I have tried and follow some link but no change found. I think is this because I have shared hosting and subdomains created from cpanel. please provide complete guidance on it.

I followed follwing links:

  1. https://forums.digitalpoint.com/threads/how-to-create-virtual-dymanic-subdomain-in-php-with-htaccess.1521742/

  2. virtual subdomain htaccess

  3. How do i create a virtual subdomain using htaccess?

  4. http://www.webmasterworld.com/apache/3638570.htm

But still my problem is not solved. It always gives Ooops could not find..

  • 写回答

1条回答 默认 最新

  • duanpi7578 2014-09-19 06:16
    关注

    I had the same issue before, you must use cpanel to create the subdomain. If I remember right there was a dns issue with this code:

    RewriteBase /
    RewriteCond %{HTTP_HOST} !^www\.domain\.com [NC]
    RewriteCond %{HTTP_HOST} ([^\.]+)\.domain\.com [NC]
    RewriteCond %{REQUEST_URI} !^/index [NC]
    RewriteRule ^(.*) http://domain.com/%1 [P]
    

    If you don't want to use cpanel creating wildcard domain entry such as *.domain.com should help.

    评论

报告相同问题?

悬赏问题

  • ¥15 目详情-五一模拟赛详情页
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 unity第一人称射击小游戏,有demo,在原脚本的基础上进行修改以达到要求
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b