Joomla.it Forum

Componenti per Joomla! => SEO => : siriuxs 26 Apr 2008, 17:39:00

: sh404SEF non mi riscrive gli url sulla home...
: siriuxs 26 Apr 2008, 17:39:00
Salve a tutti,

da poco ho installato sh404SEF sul mio nuovo portale che pubblicherò a breve www.pchs.it/portal

Purtroppo ho riscontrato questa anomalia... se Clicco su articoli, poi su schede madri ecc... il link si compone in maniera corretta, mantre se clicco su un link di un articolo presente sulla home ques'ultimo non è scritto correttamente ma è del tipo 45/41.html perchè?

Provate stesso voi...
: Re: sh404SEF non mi riscrive gli url sulla home...
: sali40 26 Apr 2008, 20:46:58
1) l'htaccess. hai commentato le parti relative al seo del core di joomla e decommentato quelle relative al seo di terze parti? (la soluzione migliore sarebbe quella di copiare l'htaccess presente dìnella documentazione del componente);

2) sei certo di aver attivato il componente (dal pannello di controllo del componente -> configurazione) e il modulo (dalla gestione dei moduli ->shmetatags - o qualcosa del genere  ;D )
: Re: sh404SEF non mi riscrive gli url sulla home...
: siriuxs 27 Apr 2008, 13:27:38
Ho fatto tutto come hai detto, ma niente... Ma perchè ? Cosa non ho fatto o dovrei fare?
: Re: sh404SEF non mi riscrive gli url sulla home...
: sali40 27 Apr 2008, 19:38:23
Il fatto è che parrebbe proprio non esistere seo se non quello nativo di joomla. Parrebbe proprio non attivo sh404
: Re: sh404SEF non mi riscrive gli url sulla home...
: siriuxs 28 Apr 2008, 14:49:32
Ma quello di joomla nativo lo devo disattivare?
: Re: sh404SEF non mi riscrive gli url sulla home...
: sali40 28 Apr 2008, 18:28:31
no. deve stare attivato.
Deve anche essere modificato l'htaccess, attivato il componente e attivato il modulo. Attenzione, il modulo va piazzato nell'ultima posizione disponibile del template (solitamente debug).
: Re: sh404SEF non mi riscrive gli url sulla home...
: siriuxs 29 Apr 2008, 11:31:55
Ma il modulo io non ce l'ho...:S Ho installato il componente, ma in moduli non mi compare...

Che modulo dovrebbe comparire?
: Re: sh404SEF non mi riscrive gli url sulla home...
: bortolani 29 Apr 2008, 11:37:55
Ciao Siriuxs,
il problema che dici tu è dovuto a JoomFish e, in particolare, al modulo mod_jflanguageselection.php.

In questo modulo c'è la funzione  _createHRef( $code ) che crea i link per le diverse lingue in ciascuna pagina. In particolare alla fine di questa funzione viene chiamata la funzione  sefRelToAbs che prende una URL 'vecchia' e la fa diventare una URL google friendly.

Ora, questa funzione quando riconosce che il link si riferisce alla home page la trasforma sempre in www.miosito.com e in questo modo, se la tua pagina effettua un riindirizzamento della lingua, ti riporta nella lingua sbagliata.

E' difficile intervenire sulla funzione sefRelToAbs, mentre è abbastanza semplice modificare _createHRef forzando alla fine una cosa del genere:

:
// Bruno - dirty hack to redirect correctly in home page
$href = sefRelToAbs( $href );
//echo $href ."<br />";
if ($href == "http://www.miosito.com/" ) {
$href = "http://www.miosito.com/index.php?lang=en";
}
return  $href;

E' veramente una modifica 'brutale' e me ne vergogno, però funziona!

Bruno
: Re: sh404SEF non mi riscrive gli url sulla home...
: siriuxs 29 Apr 2008, 12:56:55
Ma io joomlafish non ce l'ho installato :S
: Re: sh404SEF non mi riscrive gli url sulla home...
: sali40 29 Apr 2008, 21:13:20
(per risolvere il problema con joomfish c'è il modulo sostitutivo di sh404. si spubblica quello di joomfish e si pubblica quello di sh)
ma come non hai il modulo? è joomla 1.5?
: Re: sh404SEF non mi riscrive gli url sulla home...
: siriuxs 30 Apr 2008, 15:30:28
Ma io joomfish non ce l'ho installato... :( Che modulo dovrei avere?

Fatemi capire please...
: Re: sh404SEF non mi riscrive gli url sulla home...
: sali40 30 Apr 2008, 22:15:45
no, il discorso era riferito a joomfish. Piuttosto, visto che sei in sottocartella, sei sicuro di aver indicato la sottocartella nell'htaccess?
: Re: sh404SEF non mi riscrive gli url sulla home...
: siriuxs 01 May 2008, 11:51:41
Ma io il file .htaccess ce l'h comunque stesso nella sotto cartella... Ovvero c'è l'ho comunque nella cartella portal

Ma se ti creo un account puoi controllare un attimo tu? :( Ti scongiuro?
: Re: sh404SEF non mi riscrive gli url sulla home...
: sali40 01 May 2008, 14:10:12
posta l'htaccess che hai nella sottocartella. Sono convinto che il problema stia li
: Re: sh404SEF non mi riscrive gli url sulla home...
: siriuxs 01 May 2008, 18:55:21
Prefazione... Il portale joomla si trova nella cartella portal infatti è raggiungibile da www.pchs.it/portal

Il file .htacces è comunque presente nella cartella portal

Di seguito il suo contenuto:
:
##
# @version $Id: htaccess.txt 9975 2008-01-30 17:02:11Z 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


#  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
############# Use this section if using ONLY Joomla! core SEF
## ALL (RewriteCond) lines in this section are only required if you actually
## have directories named 'content' or 'component' on your server
## If you do not have directories with these names, comment them out.
#
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR] ##optional - see notes##
#RewriteCond %{REQUEST_URI} (/|\.htm|\.php|\.html|/[^.]*)$ [NC]
#RewriteRule ^(content/|component/) index.php
#
########## End - Joomla! core SEF Section


########## Begin - 3rd Party SEF Section
############# Use this section if you are using a 3rd party (Non Joomla! core) SEF extension - e.g. OpenSEF, 404_SEF, 404SEFx, SEF Advance, etc
#
RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR] ##optional - see notes##
RewriteCond %{REQUEST_URI} (/|\.htm|\.php|\.html|/[^.]*)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php
#
########## End - 3rd Party SEF Section
: Re: sh404SEF non mi riscrive gli url sulla home...
: sali40 01 May 2008, 20:02:11
Provalo così.
:
##
# @version $Id: htaccess.txt 9975 2008-01-30 17:02:11Z 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


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

RewriteBase /portal


########## Begin - Joomla! core SEF Section
############# Use this section if using ONLY Joomla! core SEF
## ALL (RewriteCond) lines in this section are only required if you actually
## have directories named 'content' or 'component' on your server
## If you do not have directories with these names, comment them out.
#
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR] ##optional - see notes##
#RewriteCond %{REQUEST_URI} (/|\.htm|\.php|\.html|/[^.]*)$ [NC]
#RewriteRule ^(content/|component/) index.php
#
########## End - Joomla! core SEF Section


########## Begin - 3rd Party SEF Section
############# Use this section if you are using a 3rd party (Non Joomla! core) SEF extension - e.g. OpenSEF, 404_SEF, 404SEFx, SEF Advance, etc
#
RewriteCond %{REQUEST_URI} ^(/portal/component/option,com) [NC,OR] ##optional - see notes##
RewriteCond %{REQUEST_URI} (/|\.htm|\.php|\.html|/[^.]*)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php
#
########## End - 3rd Party SEF Section

Però mi pare comunque strano che non abbia righe di sicurezza per bloccare gli exploit. E' tutto qui il tuo htaccess?
Ti ho già chiesto che versione di joomla?
Se è 1.0.x, aggiungi queste righe in coda:

:
#
#
########## 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

: Re: sh404SEF non mi riscrive gli url sulla home...
: sali40 01 May 2008, 20:07:04
Scusami, non sono stato molto chiaro. Le righe di sicurezza vanno aggiunte comunque. Sia che tu abbia 1.0.x sia che tu abbia 1.5.x
: Re: sh404SEF non mi riscrive gli url sulla home...
: siriuxs 01 May 2008, 22:33:00
Ma la cosa strana sai qual'è? E' che nonostante io abbia commentato le stringhe di default di joomla comunque continua a riscrivermi le url in modo sbagliato. Comunque ora provo a modificare il file htaccess come mi hai detto tu e ti faccio sapere...
: Re: sh404SEF non mi riscrive gli url sulla home...
: siriuxs 01 May 2008, 22:36:11
Niente non va.. stranissimo.. vai stesso tu su www.pchs.it/portal
In pratica i link sulla home sono del tipo numero.html mentre se vai prima nella sezione articoli ecc..ecc.. il link diventa corretto...:S

Nessuna idea?