SVN 内的 .htaccess

发布于 2024-10-31 03:49:38 字数 2830 浏览 1 评论 0原文

在我的本地主机中,我有:

XAMPP SVN 文件夹中存在 joomla 文件

问题:

acgedu 文件夹内的 .htaccess 文件无法正常工作。 IT 并未进行重定向。

有什么想法吗?最后一行重定向不起作用?

#####################################################
#  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 dissallows 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.
#
#####################################################

##  Can be commented out if causes errors, see notes above.
# For security reasons, Option followsymlinks cannot be overridden.
#Options +FollowSymLinks
Options +SymLinksIfOwnerMatch

#
#  mod_rewrite in use

RewriteEngine On

#RewriteCond %{HTTP_HOST} !www.acgedu.com
#RewriteRule (.*) http://www.acgedu.com/$1 [R=301,L]

########## 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!
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
Redirect statement

In my localhost I have:

XAMPP
SVN FOLDER having joomla files

the problem:

The .htaccess file inside acgedu folder is not working. IT is not redirecting.

any thoughts? Last line Redirect is not working?

#####################################################
#  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 dissallows 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.
#
#####################################################

##  Can be commented out if causes errors, see notes above.
# For security reasons, Option followsymlinks cannot be overridden.
#Options +FollowSymLinks
Options +SymLinksIfOwnerMatch

#
#  mod_rewrite in use

RewriteEngine On

#RewriteCond %{HTTP_HOST} !www.acgedu.com
#RewriteRule (.*) http://www.acgedu.com/$1 [R=301,L]

########## 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!
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
Redirect statement

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

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

发布评论

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

评论(1

水染的天色ゝ 2024-11-07 03:49:38

.htaccess 文件适用于它们所在的目录和任何子目录(除非被覆盖)。您需要将 .htaccess 文件恢复原样,使其直接位于“acgedu”文件夹中。

.htaccess files work for the directory they're in and any subdirectories (unless overridden). You need to bump the .htaccess file back so it's directly in the "acgedu" folder.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文