[英]htaccess hide subdirectory from url after redirect
我在本地服務器上運行了相同的應用程序-一個在“ localhost”中,另一個在“ localhost / bss /”中。 我的域端口已轉發給他們。 因此www.domain.com:1111和sub.domain2.info:1111指向本地主機。 現在他們兩個都顯示localhost。 我需要將sub.domain2.info:1111(localhost)重定向到sub.domain2.com:1111/bss/(localhost / bss),但不想看到'/ bss'
我在本地主機的.htaccess當前是這樣的-
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
Options -Indexes
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)sub.domain2.info:1111$
RewriteRule (.*) /bss/$1 [R=301,L]
在localhost / bss中的.htaccess中沒有什么特別的-
RewriteEngine On
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
Options -Indexes
非常感謝您的回復。 嘗試了一些,但似乎無濟於事!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.