Visualizzazione risultati 1 fino 7 di 7

Discussione: Problema .htaccess

  1. #1
    Guest

    Predefinito Problema .htaccess

    Allora sto usando il cms drupal, e sto provando ad attivare le clean urls, per ora senza successo.

    Ho settato l'.htaccess da gestione files ma mi dà errore 500.

    Il file:
    Codice:
    #
    # Apache/PHP/Drupal settings:
    #
    
    # Protect files and directories from prying eyes.
    <Files ~ "(\.(inc|module|pl|sh|sql|theme|engine|xtmpl)|Entries|Repositories|Root|scripts|updates)$">
      Order deny,allow
      Deny from all
    </Files>
    
    # Set some options.
    Options -Indexes
    Options +FollowSymLinks
    
    # Customized error messages.
    ErrorDocument 404 /index.php
    
    # Set the default handler.
    DirectoryIndex index.php
    
    # Override PHP settings. More exist in sites/default/settings.php, but
    # the following cannot be changed at runtime. The first IfModule is
    # for Apache 1.3, the second for Apache 2.
    <IfModule mod_php4.c>
      php_value magic_quotes_gpc                0
      php_value register_globals                0
      php_value session.auto_start              0
    </IfModule>
    
    <IfModule sapi_apache2.c>
      php_value magic_quotes_gpc                0
      php_value register_globals                0
      php_value session.auto_start              0
    </IfModule>
    
    # Reduce the time dynamically generated pages are cache-able.
    <IfModule mod_expires.c>
      ExpiresByType text/html A1
    </IfModule>
    
    # Various rewrite rules.
    <IfModule mod_rewrite.c>
      RewriteEngine on
    
      # Modify the RewriteBase if you are using Drupal in a subdirectory and
      # the rewrite rules are not working properly.
      #RewriteBase /drupal
    
      # Rewrite old-style URLs of the form 'node.php?id=x'.
      #RewriteCond %{REQUEST_FILENAME} !-f
      #RewriteCond %{REQUEST_FILENAME} !-d
      #RewriteCond %{QUERY_STRING} ^id=([^&]+)$
      #RewriteRule node.php index.php?q=node/view/%1 [L]
    
      # Rewrite old-style URLs of the form 'module.php?mod=x'.
      #RewriteCond %{REQUEST_FILENAME} !-f
      #RewriteCond %{REQUEST_FILENAME} !-d
      #RewriteCond %{QUERY_STRING} ^mod=([^&]+)$
      #RewriteRule module.php index.php?q=%1 [L]
    
      # Rewrite current-style URLs of the form 'index.php?q=x'.
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
    </IfModule>
    
    # $Id: .htaccess,v 1.66 2005/03/20 19:15:00 dries Exp $
    Grazie in anticipo,
    colt

  2. #2
    Guest

    Predefinito

    Ho tolto tutto quello che non riguardava il rewrite, come suggerito da evcz, ma ora drupal sostiene che mod_rewrite non è attivo :P .

    Il codice ora è questo:

    Codice:
    #
    # Apache/PHP/Drupal settings:
    #
    
    # Various rewrite rules.
    <IfModule mod_rewrite.c>
      RewriteEngine on
    
      # Modify the RewriteBase if you are using Drupal in a subdirectory and
      # the rewrite rules are not working properly.
      #RewriteBase /drupal
    
      # Rewrite old-style URLs of the form 'node.php?id=x'.
      #RewriteCond %{REQUEST_FILENAME} !-f
      #RewriteCond %{REQUEST_FILENAME} !-d
      #RewriteCond %{QUERY_STRING} ^id=([^&]+)$
      #RewriteRule node.php index.php?q=node/view/%1 [L]
    
      # Rewrite old-style URLs of the form 'module.php?mod=x'.
      #RewriteCond %{REQUEST_FILENAME} !-f
      #RewriteCond %{REQUEST_FILENAME} !-d
      #RewriteCond %{QUERY_STRING} ^mod=([^&]+)$
      #RewriteRule module.php index.php?q=%1 [L]
    
      # Rewrite current-style URLs of the form 'index.php?q=x'.
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
    </IfModule>
    
    # $Id: .htaccess,v 1.66 2005/03/20 19:15:00 dries Exp $

  3. #3
    L'avatar di Gianluca
    Gianluca non è connesso Amministratore
    Data registrazione
    15-02-2001
    Messaggi
    18,035

    Predefinito

    Togli

    <IfModule mod_rewrite.c>
    </IfModule>

    Non è necessario, si tratta solo di costrutti condizionali che servono per verificare se il webserver supporta il modulo, che di fatto è supportato.
    Gianluca

  4. #4
    Guest

    Predefinito

    Nulla da fare... posto sempre il codice per sicurezza
    Codice:
    #
    # Apache/PHP/Drupal settings:
    #
    
    # Modify the RewriteBase if you are using Drupal in a subdirectory and
    # the rewrite rules are not working properly.
    #RewriteBase /drupal
    
    # Rewrite old-style URLs of the form 'node.php?id=x'.
    #RewriteCond %{REQUEST_FILENAME} !-f
    #RewriteCond %{REQUEST_FILENAME} !-d
    #RewriteCond %{QUERY_STRING} ^id=([^&]+)$
    #RewriteRule node.php index.php?q=node/view/%1 [L]
    
    # Rewrite old-style URLs of the form 'module.php?mod=x'.
    #RewriteCond %{REQUEST_FILENAME} !-f
    #RewriteCond %{REQUEST_FILENAME} !-d
    #RewriteCond %{QUERY_STRING} ^mod=([^&]+)$
    #RewriteRule module.php index.php?q=%1 [L]
    
    # Rewrite current-style URLs of the form 'index.php?q=x'.
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
    
    # $Id: .htaccess,v 1.66 2005/03/20 19:15:00 dries Exp $

  5. #5
    L'avatar di Gianluca
    Gianluca non è connesso Amministratore
    Data registrazione
    15-02-2001
    Messaggi
    18,035

    Predefinito

    Attento però, questa volta hai dimenticato: RewriteEngine on
    Gianluca

  6. #6
    Guest

    Predefinito

    Nulla :(

    Codice:
    #
    # Apache/PHP/Drupal settings:
    #
    
    RewriteEngine on
    
    # Modify the RewriteBase if you are using Drupal in a subdirectory and
    # the rewrite rules are not working properly.
    #RewriteBase /drupal
    
    # Rewrite old-style URLs of the form 'node.php?id=x'.
    #RewriteCond %{REQUEST_FILENAME} !-f
    #RewriteCond %{REQUEST_FILENAME} !-d
    #RewriteCond %{QUERY_STRING} ^id=([^&]+)$
    #RewriteRule node.php index.php?q=node/view/%1 [L]
    
    # Rewrite old-style URLs of the form 'module.php?mod=x'.
    #RewriteCond %{REQUEST_FILENAME} !-f
    #RewriteCond %{REQUEST_FILENAME} !-d
    #RewriteCond %{QUERY_STRING} ^mod=([^&]+)$
    #RewriteRule module.php index.php?q=%1 [L]
    
    # Rewrite current-style URLs of the form 'index.php?q=x'.
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
    
    # $Id: .htaccess,v 1.66 2005/03/20 19:15:00 dries Exp $

  7. #7
    Guest

    Predefinito

    Ci sono riuscito leggendo questo post: http://drupal.org/node/14091#comment-22488

    Praticamente bisognava specificare la cartella anche se secondo drupal non era necessario ;) .

    Grazie comunque per l'aiuto.


    Codice:
    #
    # Apache/PHP/Drupal settings:
    #
    
    RewriteEngine on
    
    # Modify the RewriteBase if you are using Drupal in a subdirectory and
    # the rewrite rules are not working properly.
    #RewriteBase /drupal
    
    # Rewrite old-style URLs of the form 'node.php?id=x'.
    #RewriteCond %{REQUEST_FILENAME} !-f
    #RewriteCond %{REQUEST_FILENAME} !-d
    #RewriteCond %{QUERY_STRING} ^id=([^&]+)$
    #RewriteRule node.php index.php?q=node/view/%1 [L]
    
    # Rewrite old-style URLs of the form 'module.php?mod=x'.
    #RewriteCond %{REQUEST_FILENAME} !-f
    #RewriteCond %{REQUEST_FILENAME} !-d
    #RewriteCond %{QUERY_STRING} ^mod=([^&]+)$
    #RewriteRule module.php index.php?q=%1 [L]
    
    # Rewrite current-style URLs of the form 'index.php?q=x'.
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
    
    # $Id: .htaccess,v 1.66 2005/03/20 19:15:00 dries Exp $

Regole di scrittura

  • Non puoi creare nuove discussioni
  • Non puoi rispondere ai messaggi
  • Non puoi inserire allegati.
  • Non puoi modificare i tuoi messaggi
  •