[英]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.