Joomla.it Forum

Componenti per Joomla! => SEO => : aked 16 Nov 2012, 15:26:33

: Modificare file htaccess RISOLTO
: aked 16 Nov 2012, 15:26:33
Devo aggiungere il codice per rimuovere il suffisso html alle pagine del mio sito, ma modificando il file htacces nn cambia niente. Devo inserire il codice in qualche riga particolare?
Il codice è questo:


RewriteEngine On RewriteCond %{HTTP_HOST} !^miosito.it$ [NC] RewriteRule ^(.*)$ http://miosito.it/ (http://miosito.it/)$1 [L,R=301]
 
edited by tt8: per cortesia titoli in minuscolo!

: Re:MODIFICARE FILE HTACCESS
: alexdi 16 Nov 2012, 21:32:13
Perchè da htaccess ?


Puoi intervenire sulle impostazioni SEO nella configurazione globale di joomla.
: Re:MODIFICARE FILE HTACCESS
: aked 16 Nov 2012, 22:21:21
Non so dove trovare l'impostazione, avevo trovato il codice e pensavo si potesse fare solo agendo sul htaccess.
: Re:MODIFICARE FILE HTACCESS
: laboseo 17 Nov 2012, 00:40:47
L'opzione per togliere il suffisso si trova insieme a quella dell'attivazione degli url SEO friendly. Da configurazione globale, sito.


Se riesci a farlo metti risolto nell'oggetto della discussione.
: Re:Modificare file htaccess
: aked 17 Nov 2012, 11:48:28
Se seleziono NO all opzione aggiungi il suffisso agli URL, mi da l errore 404...come mai?
: Re:Modificare file htaccess
: laboseo 17 Nov 2012, 12:38:33
Nella root è presente il file htaccess.txt?
: Re:Modificare file htaccess
: aked 17 Nov 2012, 12:39:47
Sisi, è presente quel file
: Re:Modificare file htaccess
: laboseo 17 Nov 2012, 12:43:36
Se non l'hai già fatto rinominalo in .htaccess e inserisci questa stringa:
:
RewriteEngine On RewriteCond %{HTTP_HOST} !^miosito.it$ [NC] RewriteRule ^(.*)$ http://miosito.it/$1 [L,R=301]
: Re:Modificare file htaccess
: aked 17 Nov 2012, 12:44:42
sisi gia fatto, ma non cambiava nulla...adesso riprovo, per caso sai dirmi in che riga devo inserirlo?
: Re:Modificare file htaccess
: laboseo 17 Nov 2012, 12:46:29
Fatti una copia di backup di quel file, ma per inserire quella stringa cancella tutto quello che c'è prima. ;D
(Hai un hosting Linux, vero?)
: Re:Modificare file htaccess
: aked 17 Nov 2012, 12:48:18
Come cancella tutto quello che cè prima, ci sono diverse righe di codice, non vorrei fa danni (mi copio il file sul pc)...cioè per inserire quel codice htaccess deve essere pulito?
: Re:Modificare file htaccess
: laboseo 17 Nov 2012, 12:50:43
Sì e si fa prima a farlo che a dirlo.  ::)


Tuttavia la modifica non può funzionare se usi un Hosting windows, se non rinomini htaccess.txt in .htaccess o se il tuo hosting non supporta il Mod Rewrite.
: Re:Modificare file htaccess
: aked 17 Nov 2012, 12:53:24
allora il mod_rewrite è attivato, perche cè anche la dicitura #  mod_rewrite in use
: Re:Modificare file htaccess
: alexdi 17 Nov 2012, 13:03:24
Questo è un htaccess funzionante.



:

##
# @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
: Re:Modificare file htaccess
: aked 17 Nov 2012, 13:05:34
Ok, è uguale al mio
: Re:Modificare file htaccess
: alexdi 17 Nov 2012, 13:13:23
Sicuro ?


Quindi è identico ? senza aggiunte ?


Per sicurezza l' hai copiato nel tuo  ?
: Re:Modificare file htaccess
: aked 17 Nov 2012, 13:46:58
Sisi, l ho appena sostituito a quello vecchio e mi da errore 500.
: Re:Modificare file htaccess
: alexdi 17 Nov 2012, 14:24:02
Errore 500. quindi non 404. Sono 2 cose ben diverse.

hai errori su tutti i link ed abilitando il suffisso no?

Versione joomla 2.5 ?

Prova anche con varie combinazioni delle impostazioni seo (vedi figura)



[allegato eliminato da un amministratore essendo vecchio più di un anno]
: Re:Modificare file htaccess
: aked 17 Nov 2012, 16:12:38
Version 1.5, ho rimesso il vecchio htaccess e funziona tranquillamente. Pensandoci per adesso lascio stare cosi, quando avro intenzione di passare alla 2.5, apportero le varie modifiche. Ho il timore che combino qualche casino aggiornando joomla (ho comunque i backup).

: Re:Modificare file htaccess
: alexdi 17 Nov 2012, 17:50:02
Quello che ti ho postato è della 2.5 quindi può essere che sia diverso (non ricordo).


Ad ogni modo, se togli lo spunta al suffisso dovrebbe andare.
: Re:Modificare file htaccess
: Ultimacorsa 17 Nov 2012, 20:35:20
E' sufficente  effettuare un paio di (semplici) modifiche nel file htaccess:
commenta con un #
# Options +FollowSymLinkse riattiva, mi sembra che il tuo sia già così:
RewriteBase /

Nel caso hai più domini nello stesso spazio disco devi indicare qual'è la cartella home ed inserire il percorso:
RewriteBase /cartella dove è istallato Joomla.
cordialità.
S.
: Re:Modificare file htaccess
: aked 18 Nov 2012, 11:53:10
RewriteBase /[/size]# Options +FollowSymLinkse riattiva, scusami cosi devo modificare il file?
: Re:Modificare file htaccess
: Ultimacorsa 18 Nov 2012, 13:09:24
Scusa, c'era un refuso:


# Options +FollowSymLinks


RewriteBase /

N.B.
Il file deve essere rinominato in .htaccess ( da htaccess a .htaccess)

S.
: Re:Modificare file htaccess
: aked 18 Nov 2012, 13:38:32
Ok inserisco quel codice e rinomino il file. Grazie a tutti
: Re:Modificare file htaccess
: aked 19 Nov 2012, 00:24:30
Il file era gia .htaccess, ho incollato il codice ma rimane sempre il .html. Devo inserire il codice in una determinata riga? Devo cambiare qualche impostazione dalla configurazione joomla?


Grazie a tutti
: Re:Modificare file htaccess
: aked 19 Nov 2012, 03:42:59

Questo è il mio .htaccess, dove devo inserire il codice?

:
##
# @version $Id: htaccess.txt 14401 2010-01-26 14:10:00Z louis $
# @package Joomla
# @copyright Copyright (C) 2005 - 2010 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!
#
## Deny access to extension xml files (uncomment out to activate)
#<Files ~ "\.xml$">
#Order allow,deny
#Deny from all
#Satisfy all
#</Files>
## End of deny access to extension xml files
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
: Re:modificare htaccess
: Ultimacorsa 19 Nov 2012, 12:34:11
L'opzione per togliere il suffisso si trova insieme a quella dell'attivazione degli url SEO friendly. Da configurazione globale, sito.
Se riesci a farlo metti risolto nell'oggetto della discussione.

Questa è la risposta alla tua domanda, Laboseo ti ha già detto come fare.

Attenzione il file htacces.txt  deve essere rinominato .htaccess senza estensione, ne txt ne altro e preceduto dal punto;

Deve funzionare   :( senza aggiungere altro codice.
 
cordialità.

S.
: Re:Modificare file htaccess
: aked 19 Nov 2012, 15:51:14
Selezionando NO all'opzione AGGIUNGI IL SUFFISSO AGLI URL compare l'errore 404.
Nella root ho sia il file .htaccess che htaccess.txt.



: Re:Modificare file htaccess
: Ultimacorsa 20 Nov 2012, 21:14:39
Non è il carcere ad essere duro ma...i carcerieri.
Mi sono un pò perso e direi che bisognerebbe rifare lo stato dell'arte:
sistema operativo del server
versione joomla
se possibile indirizzo del sito.
rinominare l'estensione o nome del file htaccess.txt (poco scentifico ma fa tanto antisfiga... :-[ )
impostazione config seo di joomla funzionante
il provider lo vediamo se ci dici l'indirizzo del sito
L'htaccess lo prendo dai post precedenti, prego conferma che è identico a quello in esercizio.
Altro non mi viene niente in mente...
cordialità
 
S.
: Re:Modificare file htaccess
: aked 20 Nov 2012, 22:43:22
Il sito è www.freebiejeebies-italia.it e la versione di joomla è la 1.5. Provo a rinominare il file htaccess.txt in htacces.txt. Si il codice è quello postato nei post precedenti. Per la vesione del sistema operativo del server, dove devo controllare?

Grazie mille
: Re:Modificare file htaccess
: Ultimacorsa 20 Nov 2012, 22:55:56
Il sistema operativo: linux o windows, la versione nn e' importante.
: Re:Modificare file htaccess
: aked 20 Nov 2012, 23:26:55
Linux perche il database è MySQL, dico bene?
: Re:Modificare file htaccess
: alexdi 21 Nov 2012, 21:16:27
Se seleziono NO all opzione aggiungi il suffisso agli URL, mi da l errore 404...come mai?


Il problema è questo. Non deve darti l' errore 404.


RewriteRule ^(.*)\.html http://homepagetuosito/$1 [R=301,L]


Comunque, la direttiva sopra rimuove html dal' url ed esegue un reindirizzamento permanente.
: Re:Modificare file htaccess
: aked 21 Nov 2012, 21:45:46

Il problema è questo. Non deve darti l' errore 404.


RewriteRule ^(.*)\.html http://homepagetuosito/ (http://homepagetuosito/)$1 [R=301,L]


Comunque, la direttiva sopra rimuove html dal' url ed esegue un reindirizzamento permanente.

Ok aggiungo questo codice all' .htaccess?
: Re:Modificare file htaccess
: aked 21 Nov 2012, 21:55:05
Finalmente, ho inserito il codice ed adesso il .html non cè piu. Ultima richiesta ma l'opzione AGGIUNGI URL nelle configurazioni joomla deve essere settato su si, giusto?