Не включается "clean urls" при работающем mod_rewrite и .htaccess под Windows.
Apache/1.3.12 (Win32) PHP/5.2.3
Работоспособность mod_rewrite и .htaccess проверялась так:
Содержимое .htaccess (в корне drupal - D:/Web/htdocs/):
Затем в браузере набиралось "http://localhost/google.html"
Редирект был.
В httpd.conf:
# На всякий случай
<Directory D:/Web/>
Options Indexes Includes
AllowOverride All
Allow from all
</Directory>
<Directory D:/Web/htdocs/>
Options Indexes Includes
AllowOverride All
Allow from all
</Directory>
Больше никаких AllowOverride в httpd.conf нет.
Помогите, пожалуйста, понять из-за чего на http://localhost/?q=admin/settings/clean-urls пишет "Конфигурация вашей системы на данный момент не поддерживает этой функции.".
Комментарии
Что за сборка под виндами?
Drupal 6.10
Какой build не знаю, ибо не знаю где его посмотреть, если такое понятие вообще для drupal существует.
Последняя версия на 28.02.09
Я имел в виду как собран Apache+PHP+MySQL
Не особый специалист, поэтому сразу не въезжаю.
Все равно пока до конца не понимаю твой вопрос, но отвечу что думаю.
Не Денвер.
Ставил всё по отдельности.
PHP - как модуль Apache.
MySQL Server 4.1.14
К сожалению, не ответил.
Пиши как на настроен.
Как ставил.
Какие директории.
Какой конфиг, какие модули. Что в httpd.conf и php.ini прописывал
Подсказок давать не буду.
Я ставил друпал на винды (Apache 1.3, PHP4, PHP5, MySQL 4, Sendmail, Perl) всё было прекрасно, за исключением того, что сервер на виндах это не очень хорошо, но всё работало.
В httpd.conf вносил следующий изменения/добавления:
ServerName localhost
DocumentRoot "D:/Web/htdocs"
<Directory D:/Web/>
Options Indexes Includes
AllowOverride All
Allow from all
</Directory>
<Directory D:/Web/htdocs/>
Options Indexes Includes
AllowOverride All
Allow from all
</Directory>
DirectoryIndex index.html index.htm index.php
ScriptAlias /cgi-bin/ "D:/Web/"
ScriptAlias /cgi/ "D:/Web/"
AddType application/x-httpd-php .php
LoadModule php5_module C:/php5/php5apache.dll
AddHandler cgi-script .bat .exe .cgi
AddType text/html .shtml
AddHandler server-parsed .shtml .html .htm
В php.ini практически ничего не менял, лишь подключал расширения, ну и может еще чего по мелочи.
Весь он:
engine = On
zend.ze1_compatibility_mode = Off
short_open_tag = On
asp_tags = Off
precision = 12
y2k_compliance = On
output_buffering = Off
zlib.output_compression = Off
implicit_flush = Off
unserialize_callback_func=
serialize_precision = 100
allow_call_time_pass_reference = On
safe_mode = Off
safe_mode_gid = Off
safe_mode_include_dir =
safe_mode_exec_dir =
safe_mode_allowed_env_vars = PHP_
safe_mode_protected_env_vars = LD_LIBRARY_PATH
disable_functions =
disable_classes =
expose_php = On
max_execution_time = 60 ; Maximum execution time of each script, in seconds ; overall, last value : 30
max_input_time = 60 ; Maximum amount of time each script may spend parsing request data
memory_limit = 128M ; Maximum amount of memory a script may consume (128MB)
error_reporting = E_ALL & ~E_NOTICE
display_errors = On
display_startup_errors = Off
log_errors = Off
log_errors_max_len = 1024
ignore_repeated_errors = Off
ignore_repeated_source = Off
report_memleaks = On
track_errors = Off
variables_order = "EGPCS"
register_globals = Off
register_long_arrays = On
register_argc_argv = On
auto_globals_jit = On
post_max_size = 8M
!>magic_quotes_gpc = On
magic_quotes_runtime = Off
magic_quotes_sybase = Off
auto_prepend_file =
auto_append_file =
default_mimetype = "text/html"
doc_root =
user_dir =
extension_dir = "./ext/"
enable_dl = On
file_uploads = On
upload_max_filesize = 2M
!>allow_url_fopen = On
allow_url_include = Off
default_socket_timeout = 60
extension=php_gd2.dll
extension=php_mbstring.dll
extension=php_mysql.dll
[Syslog]
define_syslog_variables = Off
[mail function]
SMTP = localhost
smtp_port = 25
[SQL]
sql.safe_mode = Off
[ODBC]
odbc.allow_persistent = On
odbc.check_persistent = On
odbc.max_persistent = -1
odbc.max_links = -1
odbc.defaultlrl = 4096
odbc.defaultbinmode = 1
[MySQL]
mysql.allow_persistent = On
mysql.max_persistent = -1
mysql.max_links = -1
mysql.default_port =
mysql.default_socket =
mysql.default_host =
mysql.default_user =
mysql.default_password =
mysql.connect_timeout = 60
mysql.trace_mode = Off
[MySQLi]
mysqli.max_links = -1
mysqli.default_port = 3306
mysqli.default_socket =
mysqli.default_host =
mysqli.default_user =
mysqli.default_pw =
mysqli.reconnect = Off
[mSQL]
msql.allow_persistent = On
msql.max_persistent = -1
msql.max_links = -1
[PostgresSQL]
pgsql.allow_persistent = On
pgsql.auto_reset_persistent = Off
pgsql.max_persistent = -1
pgsql.max_links = -1
pgsql.ignore_notice = 0
pgsql.log_notice = 0
[Sybase]
sybase.allow_persistent = On
sybase.max_persistent = -1
sybase.max_links = -1
sybase.min_error_severity = 10
sybase.min_message_severity = 10
sybase.compatability_mode = Off
[Sybase-CT]
sybct.allow_persistent = On
sybct.max_persistent = -1
sybct.max_links = -1
sybct.min_server_severity = 10
sybct.min_client_severity = 10
[bcmath]
bcmath.scale = 0
[Informix]
ifx.default_host =
ifx.default_user =
ifx.default_password =
ifx.allow_persistent = On
ifx.max_persistent = -1
ifx.max_links = -1
ifx.textasvarchar = 0
ifx.byteasvarchar = 0
ifx.charasvarchar = 0
ifx.blobinfile = 0
ifx.nullformat = 0
[Session]
session.save_handler = files
session.use_cookies = 1
session.name = PHPSESSID
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain =
session.cookie_httponly =
session.serialize_handler = php
session.gc_probability = 1
session.gc_divisor = 100
session.gc_maxlifetime = 1440
session.bug_compat_42 = 1
session.bug_compat_warn = 1
session.referer_check =
session.entropy_length = 0
session.entropy_file =
session.cache_limiter = nocache
session.cache_expire = 180
session.use_trans_sid = 0
session.hash_function = 0
session.hash_bits_per_character = 4
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=,fieldset="
[MSSQL]
mssql.allow_persistent = On
mssql.max_persistent = -1
mssql.max_links = -1
mssql.min_error_severity = 10
mssql.min_message_severity = 10
mssql.compatability_mode = Off
mssql.secure_connection = Off
[Tidy]
tidy.clean_output = Off
[soap]
soap.wsdl_cache_enabled=1
soap.wsdl_cache_dir="/tmp"
soap.wsdl_cache_ttl=86400
[Zend]
zend_extension_manager.optimizer_ts="C:\Program Files\Zend\ZendOptimizer-3.3.0\lib\Optimizer-3.3.0"
zend_extension_ts="C:\Program Files\Zend\ZendOptimizer-3.3.0\lib\ZendExtensionManager.dll"
Сайт лежит в D:\Web\htdocs (т.е. Drupal'овский index.php там)
.htaccess там же
.htaccess:
# Apache/PHP/Drupal settings:
#
# Protect files and directories from prying eyes.
<FilesMatch "\.(engine|inc|info|install|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl|svn-base)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template|all-wcprops|entries|format)$">
Order allow,deny
</FilesMatch>
# Don't show directory listings for URLs which map to a directory.
Options -Indexes
# Follow symbolic links in this directory.
Options +FollowSymLinks
# Make Drupal handle any 404 errors.
ErrorDocument 404 /index.php
# Force simple error message for requests for non-existent favicon.ico.
<Files favicon.ico>
# There is no end quote below, for compatibility with Apache 1.3.
ErrorDocument 404 "The requested file favicon.ico was not found.
</Files>
# Set the default handler.
DirectoryIndex index.php
# Override PHP settings. More in sites/default/settings.php
# but the following cannot be changed at runtime.
# PHP 4, Apache 1.
<IfModule mod_php4.c>
php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0
php_value mbstring.http_input pass
php_value mbstring.http_output pass
php_value mbstring.encoding_translation 0
</IfModule>
# PHP 4, Apache 2.
<IfModule sapi_apache2.c>
php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0
php_value mbstring.http_input pass
php_value mbstring.http_output pass
php_value mbstring.encoding_translation 0
</IfModule>
# PHP 5, Apache 1 and 2.
<IfModule mod_php5.c>
php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0
php_value mbstring.http_input pass
php_value mbstring.http_output pass
php_value mbstring.encoding_translation 0
</IfModule>
# Requires mod_expires to be enabled.
<IfModule mod_expires.c>
# Enable expirations.
ExpiresActive On
# Cache all files for 2 weeks after access (A).
ExpiresDefault A1209600
# Do not cache dynamically generated pages.
ExpiresByType text/html A1
</IfModule>
# Various rewrite rules.
<IfModule mod_rewrite.c>
RewriteEngine on
# If your site can be accessed both with and without the 'www.' prefix, you
# can use one of the following settings to redirect users to your preferred
# URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option:
#
# To redirect all users to access the site WITH the 'www.' prefix,
# (http://example.com/... will be redirected to http://www.example.com/...)
# adapt and uncomment the following:
# RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
# RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
#
# To redirect all users to access the site WITHOUT the 'www.' prefix,
# (http://www.example.com/... will be redirected to http://example.com/...)
# uncomment and adapt the following:
# RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
# RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]
# Modify the RewriteBase if you are using Drupal in a subdirectory or in a
# VirtualDocumentRoot and the rewrite rules are not working properly.
# For example if your site is at http://example.com/drupal uncomment and
# modify the following line:
# RewriteBase /drupal
#
# If your site is running in a VirtualDocumentRoot at http://example.com/,
# uncomment the following line:
# RewriteBase /
# Rewrite URLs of the form 'x' to the form 'index.php?q=x'.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</IfModule>
# $Id: .htaccess,v 1.90.2.2 2008/11/28 09:39:33 dries Exp $
Пробовал делать следующее: в друпаловский .htaccess под
<IfModule mod_rewrite.c>
прописывалRedirect / http://www.google.ru
, при запросе http://localhost/ перебрасывал на гугл.Запрос "http://localhost/?q=user/1/" работает.
Запрос "http://localhost/user/1/" - 400 Bad Request (Your browser sent a request that this server could not understand.)
Да я тоже ставил и всё обычно нормально работало.
Windows только на localhost, хостинг будет не виндовый.
Вот ведь блин...
Решил.
Решено так: в .htaccess перед
index.php
вRewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
добавил "/", т.е. стало так:RewriteRule ^(.*)$ /index.php?q=$1 [L,QSA]
Теперь интересно с чем это было связано...
И когда необходимо добавлять слеш.
Тоже не работают clean urls
использую Drupal 7 на Win 7 на localhost ( не знаю на локальном сервере вообще должны работать эти чистые ссылки или нет?)
я уже перепробовал менять в .htaccess
apachе его видит так как добавлял в файл .htaccess мусор в виде цифр выдает ошибку 500
раскомментировал # RewriteBase
заменил RewriteRule ^ index.php [L] на RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
и добавлял слеш в
RewriteRule ^(.*)$ /index.php?q=$1 [L,QSA] как у вас перед index.ru
делал и по отдельности и все вместе ничего не помогает.