apache_conf WraOS的Laravel .htaccess

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了apache_conf WraOS的Laravel .htaccess相关的知识,希望对你有一定的参考价值。

# htaccess rules for subdomains and aliases
# to create new subdomain, create a folder www/subdom/(subdomain name)
# to create web for alias, create a folder www/domains/(whole domain name)

# htaccess pravidla pro subdomeny a samostatne weby aliasu
# pro vytvoreni subdomeny vytvorte adresar www/subdom/(nazev subdomeny)
# pro vytvoreni webu pro alias vytvorte adresar www/domains/(cely domenovy nazev)
# dalsi info a priklady: http://kb.wedos.com/r/32/webhosting-htaccess.html

#Options -MultiViews

RewriteEngine On

# cele domeny (aliasy)
RewriteCond %{REQUEST_URI} !^domains/
RewriteCond %{REQUEST_URI} !^/domains/
RewriteCond %{HTTP_HOST} ^(www\.)?(.*)$
RewriteCond %{DOCUMENT_ROOT}/domains/%2 -d
RewriteRule (.*) domains/%2/$1 [DPI]

# subdomeny (s nebo bez www na zacatku)
RewriteCond %{REQUEST_URI} !^subdom/
RewriteCond %{REQUEST_URI} !^/subdom/
RewriteCond %{HTTP_HOST} ^(www\.)?(.*)\.([^\.]*)\.([^\.]*)$
RewriteCond %{DOCUMENT_ROOT}/subdom/%2/public -d
RewriteRule (.*) subdom/%2/public/$1 [DPI]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{HTTP_HOST} ^(www\.)?(.*)\.([^\.]*)\.([^\.]*)$
RewriteCond %{DOCUMENT_ROOT}/subdom/%2/public -d
RewriteRule (.*) subdom/%2/public/index.php [L]

# aliasy - spravne presmerovani pri chybejicim /
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^domains/[^/]+/(.+[^/])$ /$1/ [R]

# subdomeny - spravne presmerovani pri chybejicim /
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^subdom/[^/]+/public/(.+[^/])$ /$1/ [R]

以上是关于apache_conf WraOS的Laravel .htaccess的主要内容,如果未能解决你的问题,请参考以下文章

apache_conf 重定向到Laravel的公用文件夹

apache_conf Laravel - 像老板一样修补(用PsySH)

apache_conf Laravel .htaccess具有安全性和优化功能

apache_conf 如何在Laravel(5.3)中包含流明(5.3)

apache_conf Laravel .htaccess文件,利用浏览器缓存和gzip压缩

apache_conf 确认请求的特征(类似于https://github.com/laravel/framework/blob/5.5/src/Illuminate/Foundation/Auth/