Ciao ragazzi ho bisogno di un vostro aiuto.
Ho lavorato benissimo in locale con drupal.
Adesso ho pubblicato il sito in remoto su tophost, disabilitando gli url semplificati, eliminando la chache come dice la Vs guida.
Il problema è il seguente, la prima pagina si vede tutti gli altri link (nodi) mi restituiscono una pagina bianca quindi non funzionano.
Come posso risolvere?
Grazie a tutti
Se sei disposto a dare un link al sito, controlleremmo. Se no, hai guardato questo: http://www.drupalitalia.org/node/9501
Prima di cliccare il link, cosa dice il browser? Simile a http://www.sito.it/?q=node/123 o http://www.sito.it/node/123 ?
Più imparo, più dubito.
Si si ho guardato tutto ma non riesco a risolvere, il ink è il seguente:
http://www.xxx.com/?q=node/1
http://www.xxx.com/?q=node/2
http://www.xxx.com/?q=node/3
http://www.xxx.com/?q=node/4
http://www.xxx.com/?q=contact
etc...
Il codice html che mi da il browser relativo alla pagina bianca è il seguente:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<title></title>
<meta name="Generator" content="Cocoa HTML Writer">
<meta name="CocoaVersion" content="949.54">
<style type="text/css">
</style>
</head>
<body>
</body>
</html>
Hai anche un index.html oltre al index.php di Drupal? Toglelo, o cambiare il nome.
Prova anche con: http://www.xxx.com/index.php?q=node/1 Va?
Più imparo, più dubito.
Non ci posso credere che era per colpa del file index.html.
Grazie 1000 jhl.verona era proprio quello il problema...
Se non ti chiedo troppo, ma come mai?
Perchè è il default dei default per Apache. Stai chiedendo un indirizzo (http://www.sito.it/) ? Si. Posso farti vedere la lista dei files? No. C'è un file index.html? Si. Fatto.
Però non mi spega perchè lo faccieva 'solo' con un query (http://www.sito.it/?q=qualcosa) e non con l'home (http://www.sito.it/). Mistero...
No, momento - tu non hai un .htaccess nel root, vero? Lo vedo che non c'è anche da qui. Hai dimenticato di trasferirlo da locale a remoto?
Più imparo, più dubito.
Se lo trasferisco non funziona più nulla ricevendo il seguente errore:
Errore 500
Errore interno del server
Il server ha incontrato un errore interno o un problema di errata configurazione e non riesce a completare la richiesta inserita.
Questo errore può essere causato da uno script CGI non funzionante o da un file .htaccess contenente degli errori.
Beh, direi che ti serve lo stesso. Hmmm, tophost. Guardando http://www.drupalitalia.org/problemi, vedo che c'è http://www.drupalitalia.org/node/7589 Fatto?
Più imparo, più dubito.
Ho copiato il codice lho incollato nel file .htaccess lo trasmesso nella root e ricevo sempre quell'errore cioe non funziona nulla
Hmmm. Spero che non avevi copiato anche i <?php e ?> nel testo - quelli sono solo per highlighting del documento...
Hmmm. E anche corrotto...
Eco qua pulito (ma senza garanzia ;-):
#
# 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,
# (<a href="http://example.com/" title="http://example.com/">http://example.com/</a>... will be redirected to <a href="http://www.example.com/" title="http://www.example.com/">http://www.example.com/</a>...)
# 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,
# (<a href="http://www.example.com/" title="http://www.example.com/">http://www.example.com/</a>... will be redirected to <a href="http://example.com/" title="http://example.com/">http://example.com/</a>...)
# 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 <a href="http://example.com/drupal" title="http://example.com/drupal">http://example.com/drupal</a> uncomment and
# modify the following line:
# RewriteBase /drupal
#
# If your site is running in a VirtualDocumentRoot at <a href="http://example.com/," title="http://example.com/,">http://example.com/,</a>
# 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>
Ho anche provato copiarlo - sembra a posto adesso...
Più imparo, più dubito.
Errore 500
Errore interno del server
Niente da fare sembra proprio allergico... che fare?
Divide and conquer. Prendi un pezzo, controlla, poi altro pezzo, ecc. Lo spezato cosi poi provare senza rischi di spezzare dei commandi:
#1
#
# 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
#2
# 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>
#3
# 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,
# (<a href="http://example.com/" title="http://example.com/">http://example.com/</a>... will be redirected to <a href="http://www.example.com/" title="http://www.example.com/">http://www.example.com/</a>...)
# 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,
# (<a href="http://www.example.com/" title="http://www.example.com/">http://www.example.com/</a>... will be redirected to <a href="http://example.com/" title="http://example.com/">http://example.com/</a>...)
# 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 <a href="http://example.com/drupal" title="http://example.com/drupal">http://example.com/drupal</a> uncomment and
# modify the following line:
# RewriteBase /drupal
#
# If your site is running in a VirtualDocumentRoot at <a href="http://example.com/," title="http://example.com/,">http://example.com/,</a>
# 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>
Aggiungi una alla volta, e fammi sapere quale dei pezzi inciampa...
Più imparo, più dubito.
Va tutto tranne questo:
# Follow symbolic links in this directory.
Options +FollowSymLinks
Sbaglio o bisogna sostituirlo con altro?
Provato settare Clean URLs? ?q=admin/settings/clean-urls (dice che ha superato il test?)
Quello serve perchè Apache 'segue' percorsi fatti con link simbolici (http://linuxpedia.netsons.org/index.php?title=Link_simbolici). Puoi fare tre cose:
Più imparo, più dubito.
Ho provato ad attivare gli URL SEMPLIFICATI ma cliccando sui link mi da errore 404.
Contattero Tophost sicuramente.
Per ora non sembra ci siano grosso problemi
Cmq grazie 10.000 per la disponibilità.