0 Пользователей и 1 Гость просматривают эту тему.
  • 8 Ответов
  • 2339 Просмотров
*

Romanych

  • Захожу иногда
  • 98
  • 3 / 0
ЧПУ
« : 11.12.2010, 19:53:35 »
Помогите мне решить проблемку

urlы страниц моего сайта имеют следующий вид, например:

http://mysite.ru/index.php/bra.html
http://mysite.ru/index.php/torsheri.html
http://mysite.ru/index.php/lustri.html
И так далее...

Но меня не устраивает то, что в ссылках присутствует /index.php/, то есть я хочу чтобы ссылки были вида
http://mysite.ru/bra.html
http://mysite.ru/torsheri.html
http://mysite.ru/lustri.html
то есть БЕЗ /index.php/

Полазив в Инете, почитав форумы я узнал что в настройках Joomla нужно включить mod_rewrite, что я и сделал. Ссылки приобрели нужный мне вид, но вместо страниц ошибка "404 страница не найдена".

Потом я прочитал, что нужно переименовать файл htaccess.txt в .htaccess . Это я тоже сделал. Но в этом случае сайт не работает ВООБЩЕ, а именно ошибка:

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@freehost.com.ua and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Apache/1.3.41 Server at www.mysite.ru Port 80

Как мне сделать ссылки ЧПУ на моем сайте ? (сторонние компоненты не предлагать)
« Последнее редактирование: 11.12.2010, 21:40:31 от Romanych »
*

ShadowXak

  • Завсегдатай
  • 1602
  • 162 / 6
  • no more programming
Re: ЧПУ
« Ответ #1 : 11.12.2010, 20:04:19 »
напишите хостеру пусть отконфигурирует сервер свой, а лучше сваливайте с него.
Хостер должен подключить модуль в php - mod_rewrite
и разрешить управление настройками сервера через .htaccess
*

Romanych

  • Захожу иногда
  • 98
  • 3 / 0
Re: ЧПУ
« Ответ #2 : 11.12.2010, 20:08:26 »
напишите хостеру пусть отконфигурирует сервер свой, а лучше сваливайте с него.
Хостер должен подключить модуль в php - mod_rewrite
и разрешить управление настройками сервера через .htaccess

Связался с хостером по аське, задал этот же вопрос:

Я : (задал этот же вопрос)

Техподдержка :  "Это зависит как организована работа вашего сайта. от нас это не зависит. Это стоит уточнять у разработчиков вашего скрипта. Скорее всего вам необходимо будет изменить команды для дирректир rewrite rule в файле .htaccess"

Я: то есть никаких настроек на самом хостинге делать не нужно ?

Техподдержка: нет не нужно.
*

ShadowXak

  • Завсегдатай
  • 1602
  • 162 / 6
  • no more programming
Re: ЧПУ
« Ответ #3 : 11.12.2010, 20:50:29 »
у меня на хостинге работает все без ковыряния кода и лишних телодвижений, наверно потому как хостинг профессиональный, что нельзя сказать про ваш, у вас все должно работать после инсталяции Joomla, если не работает, то тут либо руки либо хостер в вашем случае вы сделали все правильно:
1. переименовать htaccess.txt в .htaccess
2. В конфиге врубить все 3 переключателя СЕО в Да
Все Joomla должна заработать и пахать :)
*

nanobot

  • Захожу иногда
  • 54
  • 3 / 2
  • icook.dp.ua
Re: ЧПУ
« Ответ #4 : 11.12.2010, 21:38:00 »
попробуйте в htacess найти строчку RewriteBase  и дописать свой корень сайта /ваш сайт/www/
*

Romanych

  • Захожу иногда
  • 98
  • 3 / 0
Re: ЧПУ
« Ответ #5 : 11.12.2010, 22:31:02 »
Вот мой файл .htaccess

Код
##
# @version $Id: htaccess.txt 14401 2010-01-26 14:10:00Z louis $
# @package Joomla
# @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
# @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
# Joomla! is Free Software
##


#####################################################
#  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!
#
## 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

*

Romanych

  • Захожу иногда
  • 98
  • 3 / 0
Re: ЧПУ
« Ответ #6 : 11.12.2010, 23:54:57 »
Всё ! Все получилось =)

В файле .htaccess нужно было закомментировать

Options +FollowSymLinks

и всё заработало  ;)
« Последнее редактирование: 12.12.2010, 01:05:04 от Romanych »
*

ShadowXak

  • Завсегдатай
  • 1602
  • 162 / 6
  • no more programming
Re: ЧПУ
« Ответ #7 : 12.12.2010, 06:39:32 »
Почитал в нете, действительно некоторые хостеры сейчас в целях безопасности отключают функцию Options +FollowSymLinks и ее нужно закомментировать.
---
p.s. И еще раз утверждаюсь в том, что нужно сперва смотреть error.log, там кстати должно было писаться: Option FollowSymLinks not allowed here
*

Eholov

  • Захожу иногда
  • 170
  • 14 / 0
Re: ЧПУ
« Ответ #8 : 10.04.2013, 13:37:07 »
На freehost у меня не работал сайт со стандартным .htaccess и пришлось закомментировать Options +FollowSymLinks
Чтобы оставить сообщение,
Вам необходимо Войти или Зарегистрироваться