[英]Get any address from subdomains with .htaccess
我想從子域到根獲取任何URL(MVC引導)
我將以下代碼用於根文件夾:
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.*)$ boot.php?url=$1 [L]
#this code good working ...
但是對於子域,如何獲取不存在的文件?
#The following code is worked,but not get 404 folders Or files(!-d,!-f,!-l)
RewriteCond %{HTTP_HOST} ^mySubDomain.domain.com [OR]
RewriteRule ^(.*)$ /../boot.php?url=$1 [L]
我該如何添加:
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
這個代碼?
我解決了這個問題 ...
我在subdomian目錄中創建.htaccess文件
並將此代碼添加到.htaccess
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.*)$ /../boot.php?url=$1 [L]
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.