0
我的文件結構:如何配置.htacces爲超薄的子文件夾和別名重定向
-www
-- .htaccess
-- domains/
--- someAlias.com/
---- indexOfOtherWebsite.html
--- otherAlias.com/
---- indexOfAnotherWebsite.html
-- angularApp/
-- restSlim/
--- .htaccess
--- index.php
我使用的.htaccess我的虛擬主機提供商,讓我爲別名運行不同的網站產生的:
# htaccess rules for subdomains and aliases
# to create web for alias, create a folder www/domains/(whole domain name)
RewriteEngine On
RewriteCond %{REQUEST_URI} !^domains/
RewriteCond %{REQUEST_URI} !^/domains/
RewriteCond %{HTTP_HOST} ^(www\.)?(.*)$
RewriteCond %{DOCUMENT_ROOT}/domains/%2 -d
RewriteRule (.*) domains/%2/$1 [DPI]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^domains/[^/]+/(.+[^/])$ /$1/ [R]
這是斯利姆文檔一個.htacces文件:
RewriteEngine on
RewriteRule ^$ www/ [L]
RewriteRule (.*) wwww/$1 [L]
我測試了Slim應用程序工作正常,當index.php和.htaccess本身放置在web根目錄(www)。然後,我把它移到單獨的文件夾(restSlim)和改變的.htaccess文件:
RewriteEngine on
RewriteRule ^$ www/restSlim/ [L]
RewriteRule (.*) wwww/restSlim/$1 [L]
我想修身應用程序從子文件夾(restSlim)不破壞網絡的功能別名運行。我應該如何編輯這些.htaccess文件?