.htaccess htaccess重定向到子目录并隐藏它
我已经为此挣扎了一段时间 我的应用程序结构如下:.htaccess htaccess重定向到子目录并隐藏它,.htaccess,url-rewriting,.htaccess,Url Rewriting,我已经为此挣扎了一段时间 我的应用程序结构如下: - webroot - app - index.php - .htaccess 我希望当有人转到webrootwww.example.com时,会被重定向到应用程序启动的应用程序文件夹。但是,我希望URL是www.example.com,而不是www.example.com/app/ 我想我需要两个人?一个在webroot中,一个在app中 目前,/app/.htaccess看起来像: RewriteEngine
- webroot
- app
- index.php
- .htaccess
我希望当有人转到webrootwww.example.com
时,会被重定向到应用程序启动的应用程序文件夹。但是,我希望URL是www.example.com
,而不是www.example.com/app/
我想我需要两个人?一个在webroot中,一个在app中
目前,/app/.htaccess
看起来像:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php
这会从URL中隐藏
.index.php
文件。使用以下行在webroot中再创建一个.htaccess
RewriteEngine on
RewriteBase /
RewriteRule !^app/ /app%{REQUEST_URI}