Joomla 2.5阅读全部无效

时间:2014-02-01 09:39:47

标签: .htaccess joomla joomla2.5


我使用托管解决方案安装了Joomla 2.5。我已将hta​​ccess.txt重命名为.htaccess,然后激活Joomla SEO设置并更改router.php文件以删除文章ID。 一切似乎都有效,除了当我点击一个ReadAll链接(阅读文章的其余部分)时,我被重定向到: http://XXXXX.com/component/content/article/mycategory/myarticle 为什么“组件/内容/文章”包含在文章的链接中?

以下是我的.htaccess文件。

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} (<|%3C)([^s]*s)+cript.*(>|%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})
# 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 request is for something within the component folder,
# or for the site root, or for an extensionless URL, or the
# requested URL ends with one of the listed extensions
RewriteCond %{REQUEST_URI} /component/|(/[^.]*|\.(php|html?|feed|pdf|vcf|raw))$ [NC]
# 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.

有任何线索吗? 谢谢 弗朗西斯

1 个答案:

答案 0 :(得分:2)

这是默认的内容组件路由器行为。 如果您想为文章或每个类别设置自定义网址 - &gt;文章,然后您需要为该特定文章或这些文章的类别的类别菜单项创建菜单项 然后菜单项别名将用于构建该文章的URL

//添加更多信息和示例

如果您在任何类别中只分配了少量文章,并且您希望将它们用作具有预定义网址的静态页面,则为每篇文章创建一个单篇文章菜单项。 例如你有“未分类”类别的文章“文章A”。创建一个名为“Article A”的文章菜单项,然后选择相应的文章。 该文章的新(主要)网址为www.domain.com/article-a.html。

如果您有一个类别,您想发布许多文章(如博客风格):
创建类别博客菜单项,然后选择相应的类别。 然后,该类别文章的新网址将在其网址中使用您创建的菜单项的名称。