2013-03-25 2 views
2

Эта ошибка хорошо документирована, но для меня ничего не работало.Joomla «Не указан входной файл» на сервере GoDaddy

Проблема: «Нет входного файла не указано» выход при посещении любого URL с index.php в нем.

Например, http://example.com/index.php/any-url, производит «Нет указанного входного файла».

http://example.com/any-url/ работает просто отлично.

Этот сайт был недавно переведен из хоста Network Solutions в GoDaddy и использует Joomla 2.5.9 и PHP 5.3.21.

Последнее решение, которое я использовал, но не удалось, было из Joomla forum.

Если добавить это в конец файла Htaccess:

RewriteRule ^index.php/(.*)/? /$1 [L] 

Everything отображается нормально, но каждая страница занимает несколько секунд, чтобы загрузить.

файл .htaccess

#AddHandler phpini-cgi .php 
#Action phpini-cgi /cgi-bin/php5-custom-ini.cgi 
## 
# @package  Joomla 
# @copyright Copyright (C) 2005 - 2012 Open Source Matters. All rights reserved. 
# @license  GNU General Public License version 2 or later; see LICENSE.txt 
## 

## 
# 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. 
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 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. 
RewriteEngine On 
RewriteCond %{HTTP_USER_AGENT} ^BlackWidow [OR] 
RewriteCond %{HTTP_USER_AGENT} ^Bot\ mailto:[email protected] [OR] 
RewriteCond %{HTTP_USER_AGENT} ^ChinaClaw [OR] 
RewriteCond %{HTTP_USER_AGENT} ^Custo [OR] 
RewriteCond %{HTTP_USER_AGENT} ^DISCo [OR] 
RewriteCond %{HTTP_USER_AGENT} ^Download\ Demon [OR] 
RewriteCond %{HTTP_USER_AGENT} ^eCatch [OR] 
RewriteCond %{HTTP_USER_AGENT} ^EirGrabber [OR] 
RewriteCond %{HTTP_USER_AGENT} ^EmailSiphon [OR] 
RewriteCond %{HTTP_USER_AGENT} ^EmailWolf [OR] 
RewriteCond %{HTTP_USER_AGENT} ^Express\ WebPictures [OR] 
RewriteCond %{HTTP_USER_AGENT} ^ExtractorPro [OR] 
RewriteCond %{HTTP_USER_AGENT} ^EyeNetIE [OR] 
RewriteCond %{HTTP_USER_AGENT} ^FlashGet [OR] 
RewriteCond %{HTTP_USER_AGENT} ^GetRight [OR] 
RewriteCond %{HTTP_USER_AGENT} ^GetWeb! [OR] 
RewriteCond %{HTTP_USER_AGENT} ^Go!Zilla [OR] 
RewriteCond %{HTTP_USER_AGENT} ^Go-Ahead-Got-It [OR] 
RewriteCond %{HTTP_USER_AGENT} ^GrabNet [OR] 
RewriteCond %{HTTP_USER_AGENT} ^Grafula [OR] 
RewriteCond %{HTTP_USER_AGENT} ^HMView [OR] 
RewriteCond %{HTTP_USER_AGENT} HTTrack [NC,OR] 
RewriteCond %{HTTP_USER_AGENT} ^Image\ Stripper [OR] 
RewriteCond %{HTTP_USER_AGENT} ^Image\ Sucker [OR] 
RewriteCond %{HTTP_USER_AGENT} Indy\ Library [NC,OR] 
RewriteCond %{HTTP_USER_AGENT} ^InterGET [OR] 
RewriteCond %{HTTP_USER_AGENT} ^Internet\ Ninja [OR] 
RewriteCond %{HTTP_USER_AGENT} ^JetCar [OR] 
RewriteCond %{HTTP_USER_AGENT} ^JOC\ Web\ Spider [OR] 
RewriteCond %{HTTP_USER_AGENT} ^larbin [OR] 
RewriteCond %{HTTP_USER_AGENT} ^LeechFTP [OR] 
RewriteCond %{HTTP_USER_AGENT} ^Mass\ Downloader [OR] 
RewriteCond %{HTTP_USER_AGENT} ^MIDown\ tool [OR] 
RewriteCond %{HTTP_USER_AGENT} ^Mister\ PiX [OR] 
RewriteCond %{HTTP_USER_AGENT} ^Navroad [OR] 
RewriteCond %{HTTP_USER_AGENT} ^NearSite [OR] 
RewriteCond %{HTTP_USER_AGENT} ^NetAnts [OR] 
RewriteCond %{HTTP_USER_AGENT} ^NetSpider [OR] 
RewriteCond %{HTTP_USER_AGENT} ^Net\ Vampire [OR] 
RewriteCond %{HTTP_USER_AGENT} ^NetZIP [OR] 
RewriteCond %{HTTP_USER_AGENT} ^Octopus [OR] 
RewriteCond %{HTTP_USER_AGENT} ^Offline\ Explorer [OR] 
RewriteCond %{HTTP_USER_AGENT} ^Offline\ Navigator [OR] 
RewriteCond %{HTTP_USER_AGENT} ^PageGrabber [OR] 
RewriteCond %{HTTP_USER_AGENT} ^Papa\ Foto [OR] 
RewriteCond %{HTTP_USER_AGENT} ^pavuk [OR] 
RewriteCond %{HTTP_USER_AGENT} ^pcBrowser [OR] 
RewriteCond %{HTTP_USER_AGENT} ^RealDownload [OR] 
RewriteCond %{HTTP_USER_AGENT} ^ReGet [OR] 
RewriteCond %{HTTP_USER_AGENT} ^SiteSnagger [OR] 
RewriteCond %{HTTP_USER_AGENT} ^SmartDownload [OR] 
RewriteCond %{HTTP_USER_AGENT} ^SuperBot [OR] 
RewriteCond %{HTTP_USER_AGENT} ^SuperHTTP [OR] 
RewriteCond %{HTTP_USER_AGENT} ^Surfbot [OR] 
RewriteCond %{HTTP_USER_AGENT} ^tAkeOut [OR] 
RewriteCond %{HTTP_USER_AGENT} ^Teleport\ Pro [OR] 
RewriteCond %{HTTP_USER_AGENT} ^VoidEYE [OR] 
RewriteCond %{HTTP_USER_AGENT} ^Web\ Image\ Collector [OR] 
RewriteCond %{HTTP_USER_AGENT} ^Web\ Sucker [OR] 
RewriteCond %{HTTP_USER_AGENT} ^WebAuto [OR] 
RewriteCond %{HTTP_USER_AGENT} ^WebCopier [OR] 
RewriteCond %{HTTP_USER_AGENT} ^WebFetch [OR] 
RewriteCond %{HTTP_USER_AGENT} ^WebGo\ IS [OR] 
RewriteCond %{HTTP_USER_AGENT} ^WebLeacher [OR] 
RewriteCond %{HTTP_USER_AGENT} ^WebReaper [OR] 
RewriteCond %{HTTP_USER_AGENT} ^WebSauger [OR] 
RewriteCond %{HTTP_USER_AGENT} ^Website\ eXtractor [OR] 
RewriteCond %{HTTP_USER_AGENT} ^Website\ Quester [OR] 
RewriteCond %{HTTP_USER_AGENT} ^WebStripper [OR] 
RewriteCond %{HTTP_USER_AGENT} ^WebWhacker [OR] 
RewriteCond %{HTTP_USER_AGENT} ^WebZIP [OR] 
RewriteCond %{HTTP_USER_AGENT} ^Wget [OR] 
RewriteCond %{HTTP_USER_AGENT} ^Widow [OR] 
RewriteCond %{HTTP_USER_AGENT} ^WWWOFFLE [OR] 
RewriteCond %{HTTP_USER_AGENT} ^Xaldon\ WebSpider [OR] 
RewriteCond %{HTTP_USER_AGENT} ^Zeus 
RewriteRule ^.* - [F,L] 

RewriteRule ^index.php/(.*)/? /$1 [L] 
+0

опубликуйте свой файл htaccess –

+0

@MarkoD Вы получили его. – Josh

+0

Что произойдет, если вы прокомментируете 'RewriteBase /' с '#RewriteBase /' и удалите эту последнюю строку? –

ответ

4

Поскольку у вас есть ошибки в любом случае, я хотел бы предложить, чтобы полностью удалить /index.php/ из URLs, он все равно будет хорошо для SEO, и лучше.

Так просто ржали RewriteEngine on поставил

RewriteCond %{REQUEST_URI} ^/index\.php/ 
RewriteRule ^index.php/(.*) /$1 [R=301,L] 

Теперь каждый раз, когда вы пытаетесь получить доступ к http://example.com/index.php/any-url вы будете перенаправлены на http://example.com/any-url

+0

+1 Хм, это похоже на решения, которые я придумал, где я просто перенаправляю URL-адрес, ориентированный на SEO, но время загрузки страницы больше. Есть идеи, почему это так? – Josh

+0

Это перенаправление не должно иметь никакого значения для времени загрузки страницы.Вы положили это на верх, как я предложил? –

+0

Да, как вы и предполагали. Я полагал, что он не должен разбираться с файлом htaccess, но задавался вопросом, знакомы ли вы с такой проблемой. Благодарю. – Josh

1

Вы просто должны использовать URL переписывания. Перейдите к серверу Joomla, затем Site-> Global Configuration. Перейдите на вкладку «Сайт», затем, вправо под настройкой SEO, включите опцию Use URL Reewiting. Надеюсь это поможет.

0

Это так же просто, как переход в глобальную конфигурацию и преобразование URL-адреса поисковой системы из ON в OFF, и все.

-1

я действительно собирался вокруг веб-поиска для решения ...

отключение поиска дружественных URL, было волшебное решение, так просто ..

Благодаря руды за вклад. ...

+0

Плохое форматирование и не отвечает на вопрос соответствующим образом. –

Смежные вопросы