Чистые ссылки

Главные вкладки

Аватар пользователя cin cin 15 марта 2012 в 15:25

Не могу включить «Чистые ссылки» в Drupal 7.
Щелкаю Запустить проверку чистых ссылок и мне выводится «Тест "чистых URL" не пройден»

Вот мой файл .htaccess

# Protect files and directories from prying eyes.
<FilesMatch "\.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(\..*|Entries.*|Repository|Root|Tag|Template)$">
  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

# Set the default handler.
DirectoryIndex index.php index.html index.htm

# PHP 5, Apache 1 and 2.
<IfModule mod_php5.c>
  php_flag magic_quotes_gpc                 off
  php_flag magic_quotes_sybase              off
  php_flag register_globals                 off
  php_flag session.auto_start               off
  php_value mbstring.http_input             pass
  php_value mbstring.http_output            pass
  php_flag mbstring.encoding_translation    off
</IfModule>

# Requires mod_expires to be enabled.
<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresDefault A1209600
  <FilesMatch \.php$>
    ExpiresActive Off
  </FilesMatch>
</IfModule>

# Various rewrite rules.
<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteRule "(^|/)\." - [F]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_URI} !=/favicon.ico
  RewriteRule ^ index.php [L]
 
  <IfModule mod_headers.c>
    # Serve gzip compressed CSS files if they exist and the client accepts gzip.
    RewriteCond %{HTTP:Accept-encoding} gzip
    RewriteCond %{REQUEST_FILENAME}\.gz -s
    RewriteRule ^(.*)\.css $1\.css\.gz [QSA]

    # Serve gzip compressed JS files if they exist and the client accepts gzip.
    RewriteCond %{HTTP:Accept-encoding} gzip
    RewriteCond %{REQUEST_FILENAME}\.gz -s
    RewriteRule ^(.*)\.js $1\.js\.gz [QSA]

    # Serve correct content types, and prevent mod_deflate double gzip.
    RewriteRule \.css\.gz$ - [T=text/css,E=no-gzip:1]
    RewriteRule \.js\.gz$ - [T=text/javascript,E=no-gzip:1]

    <FilesMatch "(\.js\.gz|\.css\.gz)$">
      # Serve correct encoding type.
      Header set Content-Encoding gzip
      # Force proxies to cache gzipped & non-gzipped css/js files separately.
      Header append Vary Accept-Encoding
    </FilesMatch>
  </IfModule>
</IfModule>

Комментарии

Аватар пользователя cin cin 20 марта 2012 в 8:59

Решение проблемы с чистыми ссылками в Drupal 7:

открываем .htaccess и заменяем
RewriteRule ^ index.php [L]
на
RewriteRule ^(.*)$ /index.php?q=$1 [L,QSA]

Аватар пользователя usisha usisha 9 августа 2012 в 3:40

cin wrote:
Решение проблемы с чистыми ссылками в Drupal 7:

открываем .htaccess и заменяем
RewriteRule ^ index.php [L]
на
RewriteRule ^(.*)$ /index.php?q=$1 [L,QSA]

Спасибо, помогло!

Аватар пользователя MXM MXM 26 ноября 2012 в 1:42

Устанавливал Drupal в директорию и тоже была проблема с чистыми ссылками, помог вот этот код:

# RewriteCond %{REQUEST_URI} !=/favicon.ico
# RewriteRule ^(.*)$ /index.php?q=$1 [L,QSA]
#the following mods were necessary for my localhost with directory var/www/radiospares
RewriteCond %{REQUEST_URI} !=/radiospares/favicon.ico
RewriteCond %{REQUEST_URI} ^/radiospares/(.*)$
RewriteRule ^(.*)$ /radiospares/index.php?q=$1 [L,QSA]

где "radiospares" заменил на имя своей директории.

Аватар пользователя Myron Myron 26 ноября 2012 в 6:55

MXM wrote:
Устанавливал Drupal в директорию и тоже была проблема с чистыми ссылками, помог вот этот код:

# RewriteCond %{REQUEST_URI} !=/favicon.ico
# RewriteRule ^(.*)$ /index.php?q=$1 [L,QSA]
#the following mods were necessary for my localhost with directory var/www/radiospares
RewriteCond %{REQUEST_URI} !=/radiospares/favicon.ico
RewriteCond %{REQUEST_URI} ^/radiospares/(.*)$
RewriteRule ^(.*)$ /radiospares/index.php?q=$1 [L,QSA]

где "radiospares" заменил на имя своей директории.


Какой "своей директории"? Куда устанавливали Друпал, на ностинге?