首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >下面的htaccess规则有什么问题?

下面的htaccess规则有什么问题?
EN

Stack Overflow用户
提问于 2015-07-22 06:38:41
回答 1查看 47关注 0票数 1

嗨,我有一个很棒的(?)致力于修复网站上的错误。这是HTTP 500错误。它是由htaccess文件引起的。但我不知道密码出了什么问题。这是密码。

代码语言:javascript
复制
# Use PHP5 Single php.ini as default
#AddHandler application/x-httpd-php5s .php


# The rules below basically say that if the file exists in the tree, just
# serve it; otherwise, go to index.php. This is more future-proof for your
# site, because if you start adding more and more content types, you don't
# need to alter the .htaccess to accomodate them.
# This is an important concept for the Front Controller Pattern which the
# ZF MVC makes use of.

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ public/index.php [NC,L]
Redirect 301 /platforms/mt4-ecn http://example.com/
Redirect 301 /partnerships/mt4-to-mt4-bridge http://example.com/

<IfModule mod_suphp.c>
suPHP_ConfigPath /home/aaaecn/public_html 
</IfModule>
<Files php.ini> 
order allow,deny 
deny from all 
</Files>

这种重定向规则适用于zend框架,但我在使用该框架方面没有任何经验。

我注释了所有的行,并尝试现在500错误是固定的。所以我把它过滤了下来,不加评论。

RewriteRule ^.*$ - NC,L

这一行导致了错误,但是删除了这个无效的重定向和404错误。我能做些什么来解决这个问题。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-07-22 06:48:04

试试你的规则吧:

代码语言:javascript
复制
RewriteEngine On

RewriteRule ^(partnerships/mt4-to-mt4-bridge|platforms/mt4-ecn)/?$ / [L,NC,R=301]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ public/index.php [L]
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/31555635

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档