服务器中的 zend 框架部署

发布于 2024-09-24 08:13:10 字数 571 浏览 4 评论 0 原文

我有一个服务器,我在其中上传了 zend 框架中的工作(在子域中)。文件夹名称是“访问”。

因此,当我访问: http://mysitename.com/visit 时,它会显示目录结构:

Parent Directory
application/
docs/
library/
nbproject/
public/
tests/

但是当我访问: http://mysitename.com/visit/public 时,我得到索引页面我的项目。

但我想获取我的索引页,当我输入: http://mysitename.com/visit

你可以吗请给我它需要的正确的 htaccess 吗?

I have a server, where I have uploaded my work in zend framework(in a subdomain). the folder name is 'visit'.

So, When I go to: http://mysitename.com/visit, it shows a directory structure:

Parent Directory
application/
docs/
library/
nbproject/
public/
tests/

But when I go to: http://mysitename.com/visit/public, i get the index page of my project.

But I want to get my index page , when I type: http://mysitename.com/visit

can you please give me the correct htaccess it need?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

你与清晨阳光 2024-10-01 08:13:10

您可以使用以下规则集来执行此操作,该规则集部分是 文档中描述的

/visit 中的 .htaccess 文件:

RewriteEngine on

# Guard against people visiting /public/ directly
RewriteCond %{THE_REQUEST} ^[A-Z]\s/visit/public/
RewriteRule ^public/(.*)$ /visit/$1 [R=301,L]

RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
# Make sure we've rewritten to the ./public/ directory already
RewriteCond $0 ^public/
RewriteRule ^.*$ - [NC,L]
# The index file is now at /visit/public/index.php
RewriteRule ^.*$ /visit/public/index.php [NC,L]

You can do this with the following rule set, which is in part a partially modified version of the one described in the documentation.

.htaccess file in /visit:

RewriteEngine on

# Guard against people visiting /public/ directly
RewriteCond %{THE_REQUEST} ^[A-Z]\s/visit/public/
RewriteRule ^public/(.*)$ /visit/$1 [R=301,L]

RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
# Make sure we've rewritten to the ./public/ directory already
RewriteCond $0 ^public/
RewriteRule ^.*$ - [NC,L]
# The index file is now at /visit/public/index.php
RewriteRule ^.*$ /visit/public/index.php [NC,L]
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文