Joomla和非Joomla子文件夹

问题描述 投票:1回答:2

我在域的根目录级别安装了带有search-friendly-urls的Joomla,但是我的主机使我可以访问domain.com/stats中的网站统计信息(需要身份验证),但看不到它,只是Joomla产生404错误。

我以为这可能是由于.htaccess所致,所以我尝试将这一行添加到顶部:

RewriteRule ^(/stats) - [L]

但是我仍然得到404。这就是.htaccess其余部分的样子:>

##  Can be commented out if causes errors, see notes above.
Options +FollowSymLinks

#
#  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 set a mosConfig value through the URL
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
# Block out any script trying to base64_encode crap to send via URL
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
# Block out any script that includes a <script> tag in URL
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [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})
# Send all blocked request to homepage with 403 Forbidden error!
RewriteCond %{REQUEST_URI} !^/stats
RewriteRule ^(.*)$ index.php [F,L]
#
########## End - Rewrite rules to block out some common exploits

#  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
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/index.php
RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$  [NC]
RewriteRule (.*) index.php
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
#
########## End - Joomla! core SEF Section
    

我在域的根级别上安装了带有search-friendly-urls的Joomla,但是我的主机允许我访问domain.com/stats中的网站统计信息(需要身份验证,并且我...) >

.htaccess joomla
2个回答
4
投票

编辑:这些(在RewriteEngine On之后)有帮助吗?:

RewriteCond %{REQUEST_URI} ^/stats/.* [NC]
RewriteRule .* - [L]

-1
投票

我对本课程在短时间内为我提供的结果感到非常满意。通过这门课程学习Joomla就像是一趟变焦之旅。我对此course感到满意。

© www.soinside.com 2019 - 2024. All rights reserved.