|
|
|
| Подскажите пожалуйста по поводу mod_rewrite.
На хостинге все работает, локально постоянно выходит ошибка 500
Папка находится в директории:
W:\home\localhost\www
путь в браузере указываю такой http://localhost/site/
Строка в файле httpd.conf
//раскоментированна может еще что нужно прописать.
LoadModule rewrite_module modules/mod_rewrite.so
|
в начале файла .htaccess заполненно следующее:
Options -Indexes
Options +FollowSymLinks
AddDefaultCharset Off
#UTF-8
# Customized error messages.
ErrorDocument 404 /index.php
# Set the default handler.
DirectoryIndex index.php
# обеспечивающие при необходимости большую безопасность для php скриптов :
#php_value magic_quotes_gpc on
#php_flag register_globals off
<IfModule mod_rewrite.c>
RewriteEngine on
# Rewrite current-style URLs of the form 'index.php?q=x'.
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?page=$1 [QSA,L]
RewriteRule ^(site*)/(0,1)$site.php?detail=$1
# RewriteRule ^(site+)/([a-z]+)/([0-9]+)/({0,1})$site.php?&detail=$1&CategoryID=$2&TypeID=$3
</IfModule>
|
| |
|
|
|
|
|
|
|
для: Dinya_1
(02.05.2011 в 06:49)
| | 1. Если последовательно комментировать строки, то после убирания каких строк исчезает ошибка 500?
2. Что в log-файлах сообщается по поводу этой ошибке? | |
|
|
|
|
|
|
|
для: cheops
(02.05.2011 в 10:58)
| | >1. Если последовательно комментировать строки, то после убирания каких строк исчезает ошибка 500?
Ошибка 500 исчезать только когда Все закоментированно.
#Options -Indexes//
#Options +FollowSymLinks//
#AddDefaultCharset Off//
#UTF-8
# Customized error messages.
#ErrorDocument 404 /index.php
# Set the default handler.
#DirectoryIndex index.php//
# обеспечивающие при необходимости большею безопасность для скриптов php:
#php_value magic_quotes_gpc on
#php_flag register_globals off
#<IfModule mod_rewrite.c>
#RewriteEngine on
# Rewrite current-style URLs of the form 'index.php?q=x'.
#RewriteBase /
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule ^(.*)$ index.php?page=$1 [QSA,L]
# RewriteRule ^(site*)/(0,1)$site.php?detail=$1
# RewriteRule ^(site+)/([a-z]+)/([0-9]+)/({0,1})$site.php?&detail=$1&CategoryID=$2&TypeID=$3
#</IfModule>
#RewriteEngine On
#RewriteBase /
#RewriteRule ^.htaccess$ -[F]
#RewriteRule ^rss.xml$ rss.php
#AddEncoding gzip .gz
#Усиливаем кеширование
#FileETag MTime Size
#<ifmodule mod_expires.c>
#<filesmatch ".(jpg|gif|png|css|js)$">
#ExpiresActive on
#ExpiresDefault "access plus 10 year"
#</filesmatch>
#</ifmodule>
#Сжимаем компоненты сайта путем включения Gzip
#AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/javascript text/css application/x-javascript
#BrowserMatch ^Mozilla/4 gzip-only-text/html
#BrowserMatch ^Mozilla/4.0[678] no-gzip
#BrowserMatch bMSIE !no-gzip !gzip-only-text/html
#RewriteCond %{HTTP:Accept-encoding} gzip
#RewriteCond %{HTTP_USER_AGENT} !Konqueror
#RewriteCond %{REQUEST_FILENAME}.gz -f
#RewriteRule ^(.*)\.css$ $1.css.gz [QSA,L]
#<FilesMatch \.css\.gz$>
#ForceType text/css
#</FilesMatch>
#RewriteCond %{HTTP:Accept-encoding} gzip
#RewriteCond %{HTTP_USER_AGENT} !Konqueror
#RewriteCond %{REQUEST_FILENAME}.gz -f
#RewriteRule ^(.*)\.js$ $1.js.gz [QSA,L]
#<FilesMatch \.js\.gz$>
#ForceType application/x-javascript
#</FilesMatch>
#ExpiresActive On
#ExpiresDefault "access plus 10 years"
#<FilesMatch \.(php|phtml|shtml|html|xml)$>
#ExpiresActive Off
#</FilesMatch>
#<FilesMatch \.(php|phtml|shtml|html|xml)$>
#Header append Vary User-Agent
#Header append Cache-Control private
#</FilesMatch>
#<FilesMatch \.(bmp|png|gif|jpeg|ico|flv|wmf|swf|pdf|doc|rtf|css|js)$>
#Header append Cache-Control public
#</FilesMatch>
#<FilesMatch \.(js|css|bmp|png|gif|jpeg|ico|flv|wmf|swf|pdf|doc|rtf)$>
#Header unset Last-Modified
#FileETag MTime
#</FilesMatch>
#ExpiresByType image/jpeg "access plus 333 day"
#ExpiresByType image/gif "access plus 333 day"
#ExpiresByType image/png "access plus 333 day"
#ExpiresByType application/x-javascript "access plus 333 day"
#ExpiresByType text/css "access plus 333 day"
|
>2. Что в log-файлах сообщается по поводу этой ошибке?
DВ Лого сообщается следующее:
[Mon May 02 13:38:06 2011] [alert] [client 127.0.0.1] W:/home/localhost/www/list.uz_1052011/.htaccess: Illegal option Indexes// | |
|
|
|
|
|
|
|
для: dinya_1
(02.05.2011 в 12:39)
| | А вам эта опция сильно нужна? У вас разве по умолчанию отображается содержимое директории, если нет индексного файла?
| |
|
|
|
|
|
|
|
для: cheops
(02.05.2011 в 12:51)
| | > У вас разве по умолчанию отображается содержимое директории, если нет индексного файла?
В том то и дело, что без .ahtaccess говорит что страница не найдена и происходит перенаправление в сеть на сервер, где сайт и работает благополучно....
в составе сайта,0 приаблодают файлы с расширением .inc , .p , .tpl | |
|
|
|