【发布时间】:2012-01-05 12:46:10
【问题描述】:
...每当我尝试像SITE_NAME . '/includes/js/...' 这样简单的事情时,我都会得到http://localhost/SITE_NAME/SITE_NAME/includes/js/..
是否可以通过 Joomla 进行配置?我已经尝试了所有方法,但由于某种原因,我机器上的路径系统似乎坏了。我不确定它是 Joomla,还是只是我的配置。如果不是 Joomla,有人知道如何配置吗?
更新
不仅如此,通过我的机器指定的相对路径也拒绝进入我网站的文档根路径。例如,如果不将路径引导到SITE_NAME/path/to/file,我就无法执行"../../path/to/file"。相反,它只会引用http://localhost/path/to/file。当然,我收到了 404。
更新
另外,当我尝试向服务器发出http:// 请求时,我得到了相同的结果,除了现在的结果是http://localhost/somesite.com;
更新
我将发布一个完整的例子来说明我得到了什么:
(来自 Chrome 中的控制台调试器):
GET http://localhost/patention/%3C%22http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js;%22 404 (Not Found)'
我还将发布我拥有的.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!
#
## Deny access to extension xml files (uncomment out to activate)
#<Files ~ "\.xml$">
#Order allow,deny
#Deny from all
#Satisfy all
#</Files>
## End of deny access to extension xml files
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
【问题讨论】: