我使用Joomla cms运行了一个站点,在该站点中我们禁用了URL中的index.php
,但现在无法正常工作
mysite.com/index.php
然后我们尝试使用以下命令处理.htaccess
文件,然后在其主页上将其禁用
# Directs all EE web requests through the site index file
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
# 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]
#
仅在主页上正常工作
mysite.com
但是当我从主页传递到任何页面时,当我尝试使用index.php时,它将抛出错误,然后它可以工作,
mysite.com/something #throws error with this URL
mysite.com/index.php/something # works fine with this URL
即使我尝试从主页传递到任何其他页面,也需要永久禁用URL内部index.php
的帮助,在此先感谢。
您是否在开头添加了以下几行?