How to create a sub-domain in CakePHP?

前端 未结 3 1569
渐次进展
渐次进展 2021-01-06 04:59

CakePHP version-2.5.5

My domain name is http://www.thechatfun.com

Profile page link - http://www.thechatfun.com/users/profile

Chat page

3条回答
  •  没有蜡笔的小新
    2021-01-06 05:31

    As long as you can configure your domain records to point both chat and profile subdomains to your server then you can change the htaccess file in your webroot folder and add..

        
          #standard cake htaccess stuff
          ...
    
          RewriteCond %{HTTP_HOST} ^profile\.thechatfun\.com$ [NC]
          RewriteRule ^(.*)$ http://www.thechatfun.com/users/profile/$1 [R=301,L]
    
          RewriteCond %{HTTP_HOST} ^chat\.thechatfun\.com$ [NC]
          RewriteRule ^(.*)$ http://www.thechatfun.com/chats/index/$1 [R=301,L]
    
        
    

    I have this exact requirement and this works for me.

提交回复
热议问题