Htaccess ( or + Cakephp)

懵懂的女人 提交于 2019-12-25 00:35:03

问题


I would like to know how can I configure a subdomain to a website. Example www.domain.com subdomain.domain.com

How can I configure the htaccess to access the folder subdomain and use it

public_html
 app
 lib
 plugins
 vendors...
 subdomain
    app
    lib...

this is my htaccess

 <IfModule mod_rewrite.c>
   RewriteEngine on
   RewriteRule    ^$ app/webroot/    [L]
   RewriteRule    (.*) app/webroot/$1 [L]
 </IfModule>

thanks


回答1:


in public_html/.htaccess:

<IfModule mod_rewrite.c>
  RewriteEngine on

  RewriteCond    %{REQUEST_FILENAME} !subdomain/
  RewriteRule    ^$ app/webroot/    [L]   

  RewriteCond    %{REQUEST_FILENAME} !subdomain/
  RewriteRule    (.*) app/webroot/$1 [L]

</IfModule>


来源:https://stackoverflow.com/questions/21151875/htaccess-or-cakephp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!