Punto informatico Network
Login Esegui login | Non sei registrato? Iscriviti ora (è gratuito!)
Username: Password:
  • Annuncio Pubblicitario

Joomla SEO

Cerchi consigli per migliorare il tuo sito? Vuoi aprire un sito in poco tempo?
Discuti con altri webmaster, chiedi chiarimenti ed opinioni in tutta libertà.
Lo spam verrà cancellato.

Joomla SEO

Messaggioda Fred » mar ago 26, 2008 10:55 pm

Salve a tutti, ultimamente mi stò cimentando con joomla e devo dire che mi riesce abbastanza bene tranne per il fatto che non riesco ad abilitare il SEO. O meglio lo abilito ma poi non posso visualizzare altre pagine oltre l'index. Sono praticamente sicuro dipenda dal file .htaccess ma non ho capito come modificarlo. Qualcuno può fornirmi istruzioni molto dettagliate su come modificarlo? Grazie a tutti.
[ciao]
Asus M3N78SE;AMD Athlon 64X2 5200+@5400;2 GB DDR2;NVIDIA GeForce 9500GT;Windows 7 Pro 64bit;
AcerASPIRE5230;Windows 7 Pro 64bit
Skype: nellopc90
Avatar utente
Fred
Membro Ufficiale (Gold)
Membro Ufficiale (Gold)
 
Messaggi: 3623
Iscritto il: mer apr 27, 2005 4:13 pm
Località: Urbe

Re: Joomla SEO

Messaggioda Boo » mar ago 26, 2008 11:46 pm

SEO funziona solo se il tuo host permette il Mod Rewrite di Apache. Comincia a verificare che questo ti sia consentito.
Avatar utente
Boo
Silver Member
Silver Member
 
Messaggi: 1276
Iscritto il: sab dic 04, 2004 3:41 pm

Messaggioda Fred » mar ago 26, 2008 11:50 pm

Al momento sono in locale: uso XAMPP.
Asus M3N78SE;AMD Athlon 64X2 5200+@5400;2 GB DDR2;NVIDIA GeForce 9500GT;Windows 7 Pro 64bit;
AcerASPIRE5230;Windows 7 Pro 64bit
Skype: nellopc90
Avatar utente
Fred
Membro Ufficiale (Gold)
Membro Ufficiale (Gold)
 
Messaggi: 3623
Iscritto il: mer apr 27, 2005 4:13 pm
Località: Urbe


Messaggioda Fred » mar ago 26, 2008 11:56 pm

Ho abilitato ora il modulo (non credevo andasse abilitato) e, come risultato, non vedo più neppure l'index.
Asus M3N78SE;AMD Athlon 64X2 5200+@5400;2 GB DDR2;NVIDIA GeForce 9500GT;Windows 7 Pro 64bit;
AcerASPIRE5230;Windows 7 Pro 64bit
Skype: nellopc90
Avatar utente
Fred
Membro Ufficiale (Gold)
Membro Ufficiale (Gold)
 
Messaggi: 3623
Iscritto il: mer apr 27, 2005 4:13 pm
Località: Urbe

Messaggioda Boo » mer ago 27, 2008 12:10 am

XAMPP usa Apache quindi sicuramente può funzionare.

Il Mod Rewrite funziona come un redirect con variabili. Imposti un formato ed il file .htaccess automaticamente va all'url originale (mostrandolo o meno, questo spetta a te sceglierlo).

Innanzitutto il tuo .htaccess deve contenere questa riga

Codice: Seleziona tutto
RewriteEngine On

Che comunica al motore Apache di abilitare la funzione.

In secondo luogo devi scrivere i tuoi rewrite.

Ecco un esempio per chiarirci le idee

Codice: Seleziona tutto
RewriteRule ^([^/\.]+).html$ index.php?page=$1


Scomponendo nelle varie parti abbiamo
RewriteRule: questo è il comando per impostare un singolo rewrite.
^ indica l'inizio della stringa e $ la fine
Quindi ^([^/\.]+).html$ non significa altro che qualsiasi file con estensione .html mentre index.php?page=$1 è il percorso originale con la variabile ($1).
In questo esempio aprendo la pagina contatti.html non faremo altro che andare in index.php?page=contatti

Passiamo ad un secondo esempio.
Codice: Seleziona tutto
RewriteRule ^staff_([^/\.]+).html$ index.php?page=staff&action=show&member=$1


Adesso la regola (cioè la porzione tra ^ e $) comprende ^staff_([^/\.]+).html$ e reindirizza a index.php?page=staff&action=show&member=
Quindi aprendo staff_fred.html andremo a visualizzare i contenuti di index.php?page=staff&action=show&member=fred

Le RewriteRule possono essere multiple ma è buona regola metterle in ordine dalla più dettagliata alla più generica. Perciò nel nostro esempio il nostro .htaccess sarà:

Codice: Seleziona tutto
RewriteEngine On


RewriteRule ^staff_([^/\.]+).html$ index.php?page=staff&action=show&member=$1
RewriteRule ^([^/\.]+).html$ index.php?page=$1


Questo dovrebbe darti un'idea preliminare sul Mod Rewrite. Io non ho idea di come Joomla funzioni ma se mi dai del materiale su cui lavorare posso darci un'occhiata.
Avatar utente
Boo
Silver Member
Silver Member
 
Messaggi: 1276
Iscritto il: sab dic 04, 2004 3:41 pm

Messaggioda Fred » mer ago 27, 2008 12:13 am

Tutto per te il mio file .htaccess:
Codice: Seleziona tutto
##
# @version $Id: htaccess.txt 10492 2008-07-02 06:38:28Z ircmaxell $
# @package Joomla
# @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
# @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
# Joomla! is Free Software
##


#####################################################
#  READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE
#
# The line just below this section: 'Options +FollowSymLinks' may cause problems
# with some server configurations.  It is required for use of mod_rewrite, but may already
# be set by your server administrator in a way that dissallows changing it in
# your .htaccess file.  If using it causes your server to error out, comment it out (add # to
# beginning of line), reload your site in your browser and test your sef url's.  If they work,
# it has been set by your server administrator and you do not need it set here.
#
#####################################################

##  Can be commented out if causes errors, see notes above.
Options +FollowSymLinks

#
#  mod_rewrite in use

RewriteEngine On

########## Begin - Rewrite rules to block out some common exploits
## If you experience problems on your site block out the operations listed below
## This attempts to block the most common type of exploit `attempts` to Joomla!
#
# Block out any script trying to set a mosConfig value through the URL
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
# Block out any script trying to base64_encode crap to send via URL
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
# Block out any script that includes a <script> tag in URL
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Send all blocked request to homepage with 403 Forbidden error!
RewriteRule ^(.*)$ index.php [F,L]
#
########## End - Rewrite rules to block out some common exploits

#  Uncomment following line if your webserver's URL
#  is not directly related to physical file paths.
#  Update Your Joomla! Directory (just / for root)

# RewriteBase /


########## Begin - Joomla! core SEF Section
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/index.php
RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$  [NC]
RewriteRule (.*) index.php
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
#
########## End - Joomla! core SEF Section


Asus M3N78SE;AMD Athlon 64X2 5200+@5400;2 GB DDR2;NVIDIA GeForce 9500GT;Windows 7 Pro 64bit;
AcerASPIRE5230;Windows 7 Pro 64bit
Skype: nellopc90
Avatar utente
Fred
Membro Ufficiale (Gold)
Membro Ufficiale (Gold)
 
Messaggi: 3623
Iscritto il: mer apr 27, 2005 4:13 pm
Località: Urbe

Messaggioda Boo » mer ago 27, 2008 12:15 am

Come su consiglio dello stesso autore prova a commentare la riga 23: Options +FollowSymLinks
Il commento in .htaccess è un cancelletto.
#Options +FollowSymLinks
Avatar utente
Boo
Silver Member
Silver Member
 
Messaggi: 1276
Iscritto il: sab dic 04, 2004 3:41 pm

Messaggioda Fred » mer ago 27, 2008 12:22 am

Codice: Seleziona tutto
Errore del server!

Il server ha generato un errore interno e non è in grado di soddisfare la richiesta. Il server potrebbe essere sovraccarico oppure si è verificato un errore in uno script CGI.

Se pensi che questo sia un errore del server, per favore contatta il webmaster.
Error 500
localhost
08/27/08 01:19:31
Apache/2.2.9 (Win32) DAV/2 mod_ssl/2.2.9 OpenSSL/0.9.8h mod_autoindex_color PHP/5.2.6

ecco la risposta del sito
Asus M3N78SE;AMD Athlon 64X2 5200+@5400;2 GB DDR2;NVIDIA GeForce 9500GT;Windows 7 Pro 64bit;
AcerASPIRE5230;Windows 7 Pro 64bit
Skype: nellopc90
Avatar utente
Fred
Membro Ufficiale (Gold)
Membro Ufficiale (Gold)
 
Messaggi: 3623
Iscritto il: mer apr 27, 2005 4:13 pm
Località: Urbe

Re: Joomla SEO

Messaggioda Fred » lun set 01, 2008 1:22 pm

Ho capito dove sbagliavo: non impostavo "# RewriteBase /" [acc2] .
Grazie di tutto!
Asus M3N78SE;AMD Athlon 64X2 5200+@5400;2 GB DDR2;NVIDIA GeForce 9500GT;Windows 7 Pro 64bit;
AcerASPIRE5230;Windows 7 Pro 64bit
Skype: nellopc90
Avatar utente
Fred
Membro Ufficiale (Gold)
Membro Ufficiale (Gold)
 
Messaggi: 3623
Iscritto il: mer apr 27, 2005 4:13 pm
Località: Urbe


Torna a Sviluppo Web

Chi c’è in linea

Visitano il forum: Nessuno e 9 ospiti

Powered by phpBB © 2002, 2005, 2007, 2008 phpBB Group
Traduzione Italiana phpBB.it

megalab.it: testata telematica quotidiana registrata al Tribunale di Cosenza n. 22/09 del 13.08.2009, editore Master New Media S.r.l.; © Copyright 2008 Master New Media S.r.l. a socio unico - P.I. 02947530784. GRUPPO EDIZIONI MASTER Spa Tutti i diritti sono riservati. Per la pubblicità: Master Advertising