开发者

Add subdomain index page in .htaccess file

I am using zend framework and i have .htaccess file in web directory which is redirect to public/index.php . My web directory structure is given below:

webroot/
   application/
      controllers/
      views/
         scripts/
   library/
   public/
     index.php     
   tests/
   .htaccess

My .htaccess code is given below:

RewriteEngine On

RewriteRule ^\.htaccess$ - [F]

RewriteCond %{REQUEST_URI} =""
RewriteRule ^.*$ /public/index.php [NC,L]


RewriteCond %{REQUEST_URI} !^/public/.*$
RewriteRule ^(.*)$ /public/$1

RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^.*$ - [NC,L]

RewriteRule ^public/.*$ /public/index.php [NC,L]  

After that i create a subdomain i.e "sub.mydomain.com" 开发者_如何学C.

then my webroot directory given below:

webroot/
       sub/
       application/
          controllers/
          views/
             scripts/
       library/
       public/
         index.php     
       tests/
       .htaccess

when i open then error msg come :

The requested URL /public/sub/ was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

when i delete above htaccess file code then my subdomain sub.mydomain.com is open . I want to change my code of htaccess file. In which both my domaine or subdomain is run....please help me...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜