我的默认“zend”应用程序具有此默认结构
/zend + webroot
/application
/config
/library
/public
.htaccess
index.php
默认 .htaccess 通过 ./public/index.php 重定向各种控制器/操作详细信息
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
我使用这个默认网址来访问应用程序
http://domain/index.php
我现在已转移到共享主机,其中 Web 根目录位于“zend”根目录之上。
/webroot
/zend
/application
/config
/public
index.php
.htaccess
但我只能通过这个 URL 访问我的应用程序
http://domain/zend/public/index.php
我希望能够使用
http://domain/zend/index.php
并具有 .htaccess 重定向。
我想知道如何调整 .htaccess 文件来重定向 URL 请求。我读
这tutorial但我没有为我工作
/webroot
/zend
.htaccess
/application
/config
/library
/public
index.php
这是本例中的 .htaccess 内容
RewriteEngine On
RewriteRule ^\.htaccess$ - [F]
RewriteCond %{REQUEST_URI} =""
RewriteRule ^.*$ /public/index.php [NC,L]
RewriteCond %{REQUEST_URI} !^/public/.*$
RewriteRule ^(.*)$ /public/$1
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^.*$ - [NC,L]
RewriteRule ^public/.*$ /public/index.php [NC,L]
有人能发现什么吗?