Неохота делать новый топик, может заглянет кто.
Короче попросили меня тут сайтик сделать. Я так подумал и поставил сразу 1.5 бета, потом обновил... И вот уже целый день ищу одну проблему.
В общем конфиг такой:
Code: Select all
#------------
#URL Settings
#------------
#Show mod_rewrite URLs in the menu? You must enable 'use_hierarchy' for this to work for modules
$config['assume_mod_rewrite'] = true;
#Extension to use if you're using mod_rewrite for pretty URLs.
$config['page_extension'] = '.html';
#If you don't use mod_rewrite, then would you like to use the built-in
#pretty url mechanism? This will not work with IIS and the {metadata} tag
#should be in all of your templates before enabling.
$config['internal_pretty_urls'] = false; #пробовал и true
#If you're using the internal pretty url mechanism or mod_rewrite, would you like to
#show urls in their hierarchy? (ex. http://www.mysite.com/parent/parent/childpage)
$config['use_hierarchy'] = true;
#If using none of the above options, what should we be using for the query string
#variable? (ex. http://www.mysite.com/index.php?page=somecontent)
$config['query_var'] = 'page';
Конфиг хтаксесса:
Code: Select all
AddDefaultCharset UTF-8
DirectoryIndex index.html index.php
IndexIgnore *.php* *.js
DefaultLanguage ru-RU
Options +FollowSymLinks
#
<IfModule mod_rewrite.c>
RewriteEngine on
#
#Sub-dir e.g: /cmsms/
RewriteBase /
#
# 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash
RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_URI} !\.
RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L]
# Rewrites urls in the form of /parent/child/
# but only rewrites if the requested URL is not a file or directory
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
</IfModule>
А теперь самое интересное. Аналогичный конфиг на другом хосте и на версии 1.4 работает без проблем. Т.е. при наборе несуществующего адреса выдается либо 404 кмсное (если на локалке тестить) либо на самом хосте 404 страничка от хостера.
Проблема в следующем, на текущем хосте (другом) на версии 1.5 (параметры хоста):
Php Information:
* phpversion:
5.2.0-8+etch7
* md5_function:
Вкл (True)
* gd_version:
2
* tempnam_function:
Вкл (True)
* magic_quotes_runtime:
Выкл (False)
* memory_limit:
32M
* max_execution_time:
60
* safe_mode:
Выкл (False)
* session_save_path:
/var/lib/php5 (1733)
Server Information:
* Server Api:
cgi-fcgi
* Server Db Type:
MySQL (mysql)
* Server Db Version:
5.0.32
при запросе несуществующей страницы выдает пустой лист и надпись
Code: Select all
Fatal error: Call to a member function GetContent() on a non-object in /home/www/login/htdocs/index.php on line 217
И я думаю эта байда из за структуры хостера. Т.е. она такая
Реальная (ту что пишу в конфе и та что дает хостер) home/www/login/htdocs/
По фтп я вижу уже home/htdocs/
При попытке вписать htdocs в хтаксесс получаю 500 по любому запросу, и сие понятно ибо я прописываю в настройках хостера папку в которой индексный файл т.е. этот долбаный htdocs.
Я в задумчивости. Покручу может еще на локале. Хотя чую что так быть не должно, должно быть либо 404 либо выбрасывать на главную, ну не может быть по левому запросу такая выдача, неправильно это. Может в php.ini добавить или убавить чего то?
Буду благодарен если кто поможет советом.