dpmopn8542 2014-09-08 18:16
浏览 29

.htaccess子域中Laravel应用程序文件夹的最佳实践

My hosting service does not allow the creation of folders outside the public (www/) directory. However, for subdomains it automatically creates folders outside www/, for example laravel/.

I copied the content of my Laravel 4 app's public/ folder into www/ and the rest into the laravel/ folder, adjusted paths, etc. so the site works, but I don't want to inadvertently serve anything from laravel.mydomain.com.

What are the best practices in .htaccess, deny from all or a simple Redirect 301 / mydomain.com? I guess a redirect exposes that the subdomain exists, so it may not be ideal. Any issues I could have with deny?

Thanks.

EDIT: I went with Redirect 301 / http://mydomain.foo in a .htaccess file that resides in the folder where the non-public files of the Laravel app are and which Apache serves laravel.mydomain.foo from. mydomain.foo is served from the standard location the hosting service provides and contains the public files. One year down the line it has not bitten me yet. The question is still open if someone has a better approach.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 C# TCP服务端,客户端退出后,不断有数据进来
    • ¥15 HLs设计手写数字识别程序编译通不过
    • ¥15 Stata外部命令安装问题求帮助!
    • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
    • ¥15 TYPCE母转母,插入认方向
    • ¥15 如何用python向钉钉机器人发送可以放大的图片?
    • ¥15 matlab(相关搜索:紧聚焦)
    • ¥15 基于51单片机的厨房煤气泄露检测报警系统设计
    • ¥15 路易威登官网 里边的参数逆向
    • ¥15 Arduino无法同时连接多个hx711模块,如何解决?