开发者社区> 问答> 正文

关于Joomla更改.htaccess发生500错误的问题

不开SEF一切正常,开了SEF子菜单不能访问,显示access denied;开了apache重写,子菜单显示not found;改了.htaccess,前台后台都是500错误。   弹性WEB托管高级版。


各位大哥,小弟对.htaccess内的规则一窍不通,之前在其它虚机也没出现这问题,Joomla官方论坛上的方法都试了一个遍,也不能解决修改.htaccess名称发生500错误不能访问的问题。


另外:编辑Joomla后台显示 “不能让configuration.php可写”和“不能让configuration.php不可写”跟这有没有关系?  


附.htaccess规则, 求大哥们指条明路吧,多谢。

##
# @package    Joomla
# @copyright  Copyright (C) 2005 - 2016 Open Source Matters. All rights reserved.
# @license    GNU General Public License version 2 or later; see LICENSE.txt
##

##
# READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE!
#
# The line just below this section: 'Options +FollowSymLinks' may cause problems
# with some server configurations.  It is required for use of mod_rewrite, but may already
# be set by your server administrator in a way that disallows changing it in
# your .htaccess file.  If using it causes your server to error out, comment it out (add # to
# beginning of line), reload your site in your browser and test your sef url's.  If they work,
# it has been set by your server administrator and you do not need it set here.
##

## No directory listings
IndexIgnore *

## Can be commented out if causes errors, see notes above.
Options +FollowSymlinks
Options -Indexes

## Mod_rewrite in use.

RewriteEngine On

## Begin - Rewrite rules to block out some common exploits.
# If you experience problems on your site block out the operations listed below
# This attempts to block the most common type of exploit `attempts` to Joomla!
#
# Block out any script trying to base64_encode data within the URL.
RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
# Block out any script that includes a <script> tag in URL.
RewriteCond %{QUERY_STRING} (<|<)([^s]*s)+cript.*(>|>) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL.
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL.
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Return 403 Forbidden header and show the content of the root homepage
RewriteRule .* index.php [F]
#
## End - Rewrite rules to block out some common exploits.

## Begin - Custom redirects
#
# If you need to redirect some pages, or set a canonical non-www to
# www redirect (or vice versa), place that code here. Ensure those
# redirects use the correct RewriteRule syntax and the [R=301,L] flags.
#
## End - Custom redirects

##
# Uncomment following line if your webserver's URL
# is not directly related to physical file paths.
# Update Your Joomla! Directory (just / for root).
##

RewriteBase /

## Begin - Joomla! core SEF Section.
#
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
#
# If the requested path and file is not /index.php and the request
# has not already been internally rewritten to the index.php script
RewriteCond %{REQUEST_URI} !^/index\.php
# and the requested path and file doesn't directly match a physical file
RewriteCond %{REQUEST_FILENAME} !-f
# and the requested path and file doesn't directly match a physical folder
RewriteCond %{REQUEST_FILENAME} !-d
# internally rewrite the request to the index.php script
RewriteRule .* index.php [L]
#
## End - Joomla! core SEF Section.  

展开
收起
knonline 2016-08-04 19:26:38 6040 0
3 条回答
写回答
取消 提交回答
  • Re关于Joomla更改.htaccess发生500错误的问题
    你好,问题解决了吗?不知道你的ECS配置使用的是Apache还是nginx?如果使用了Apache请确保开启re_write 功能

    如果使用的是nginx,请参考nginx下的Joomla伪静态设置说明:eee-eee. com/blog-news/joomla-jiaocheng/431-%E5%9F%BA%E4%BA%8Enginx%E4%B8%8B%E7%9A%84joomla%E4%BC%AA%E9%9D%99%E6%80%81rewrite%E9%85%8D%E7%BD%AE.html

    祝顺利
    2016-09-01 01:23:32
    赞同 展开评论 打赏
  • Re关于Joomla更改.htaccess发生500错误的问题
    感谢版主,SEF指的是那个。

    尝试了启动pathinfo,还是老样子。
    2016-08-05 16:18:15
    赞同 展开评论 打赏
  • 旺旺:nectar2。
    楼主您好,

    SEF指的是这个吗? https://docs.joomla.org/Search_Engine_Friendly_URLs

    或许您可以尝试通过弹性Web托管后台里的设置,启用 pathinfo 功能后试试: https://bbs.aliyun.com/read/283864.html

    -------------------------

    回 2楼(knonline) 的帖子
    您好,

    请问您的问题已经得到解决了吗?

    是否我在Joomla官方下载最新版本程序后,能重现您遇到的现象?
    2016-08-05 11:50:37
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载