PHP Zend - 在URL中隐藏public

时间:2013-12-24 05:46:56

标签: php zend-framework

我正在使用PHP Zend作为我的项目框架。如何从此网址中删除public

我想要这种网址

http://staging.revivalx.com/zeesbio/login

而不是这个

http://staging.revivalx.com/zeesbio/public/login

http://staging.revivalx.com/zeesbio/public/login

提前多多感谢。

1 个答案:

答案 0 :(得分:0)

尝试将.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]

php_value memory_limit 64M

#add content type header 
AddDefaultCharset UTF-8
相关问题