Warning: file_get_contents(http://pop.robingood.it/transfer_data.php?a=) [function.file-get-contents]: failed to open stream: Host is down in [path]/global.php(238) : eval()'d code on line 23
POP Forum - Aiuto configurazione .htaccess
POP Forum

POP Forum (http://forum.masternewmedia.it/)
-   Domande generali sul Web Publishing (http://forum.masternewmedia.it/domande-generali-sul-web-publishing/)
-   -   Aiuto configurazione .htaccess (http://forum.masternewmedia.it/domande-generali-sul-web-publishing/826-aiuto-configurazione-htaccess.html)

nicola_10 08-27-2009 23:06

Aiuto configurazione .htaccess
 
Chiedo aiuto per inserire nel file .htaccess le regole per indirizzare da

http_//miosito_it

A

www_miosito_it

senza rompere la struttura dei permailnk

Vi inserisco il file htaccess....potete inserirmi Voi la stringa nel posto giusto...??? Perchè non riesco da solo e non vorrei rompere tutto
Grazie 10000000000


# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

Matteo Dini 08-28-2009 07:34

Devi fare un redirect di tipo 301 (permanente).

La variabile da aggiungere è:

codice:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\.nomesito\.it [NC]
RewriteRule ^(.*)$ http://www.nomesito.it/$1 [L,R=301]
</IfModule>

Ovviamente cambia "nomesito" con il nome reale del sito.

L'htaccess finale dovrà risultare:

codice:

# INIZIO Redirect con WWW
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\.nomesito\.it [NC]
RewriteRule ^(.*)$ http://www.nomesito.it/$1 [L,R=301]
</IfModule>
# FINE Redirect con WWW

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress


nicola_10 08-28-2009 12:54

grazie 1000, ma mis fugge ancora una cosa......

ho un plugin per redirect.... devo settarlo anche internamente a wp oppure basta che copio la parte file che mi hai aggiunto a quella esistente?

Grazie 1000 ancora

Matteo Dini 08-28-2009 13:43

Non mi hai parlato di plugin :)

E' necessario sapere cosa hai impostato nel plugin del redirect su WP.
A cosa ti serve questo plugin ?

Se hai configurato la stessa cosa, cioè redirigere il sito da http:// con WWW, rischi di creare dei cicli infiniti e pertanto devi decidere se di l'uno o l'altro.

Comunque effettuare un redirect dal .htaccess è la miglior soluzione.

nicola_10 08-28-2009 13:48

Non ho ancora settato niente tramite wp

aspettavo notizie

ho inserito la tua modifica

e il risultato è:

# BEGIN WPSuperCache
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
AddDefaultCharset UTF-8
RewriteCond %{REQUEST_URI} !^.*[^/]$
RewriteCond %{REQUEST_URI} !^.*//.*$
RewriteCond %{REQUEST_METHOD} !=POST
RewriteCond %{QUERY_STRING} !.*=.*
RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress|wp-postpass_).*$
RewriteCond %{HTTP_user_agent} !^.*(Android|2.0\ MMP|240x320|AvantGo|BlackBerry|Blazer|Cellphone|Da nger|DoCoMo|Elaine/3.0|EudoraWeb|hiptop|IEMobile|iPhone|iPod|KYOCERA/WX310K|LG/U990|MIDP-2.0|MMEF20|MOT-V|NetFront|Newt|Nintendo\ Wii|Nitro|Nokia|Opera\ Mini|Palm|Playstation\ Portable|portalmmm|Proxinet|ProxiNet|SHARP-TQ-GX10|Small|SonyEricsson|Symbian\ OS|SymbianOS|TS21i-10|UP.Browser|UP.Link|Windows\ CE|WinWAP).*
RewriteCond %{HTTP:Accept-Encoding} gzip
RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz -f
RewriteRule ^(.*) /wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz [L]

RewriteCond %{REQUEST_URI} !^.*[^/]$
RewriteCond %{REQUEST_URI} !^.*//.*$
RewriteCond %{REQUEST_METHOD} !=POST
RewriteCond %{QUERY_STRING} !.*=.*
RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress|wp-postpass_).*$
RewriteCond %{HTTP_user_agent} !^.*(Android|2.0\ MMP|240x320|AvantGo|BlackBerry|Blazer|Cellphone|Da nger|DoCoMo|Elaine/3.0|EudoraWeb|hiptop|IEMobile|iPhone|iPod|KYOCERA/WX310K|LG/U990|MIDP-2.0|MMEF20|MOT-V|NetFront|Newt|Nintendo\ Wii|Nitro|Nokia|Opera\ Mini|Palm|Playstation\ Portable|portalmmm|Proxinet|ProxiNet|SHARP-TQ-GX10|Small|SonyEricsson|Symbian\ OS|SymbianOS|TS21i-10|UP.Browser|UP.Link|Windows\ CE|WinWAP).*
RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html -f
RewriteRule ^(.*) /wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html [L]
</IfModule>

# END WPSuperCache

# INIZIO Redirect con WWW
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\_gommeblog\_it [NC]
RewriteRule ^(.*)$ http://www_gommeblog_it/$1 [L,R=301]
</IfModule>
# FINE Redirect con WWW

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress


ma non funziona.....ho provato

se scrivo
http_//gommeblog_it

mi restituisce errore

nicola_10 08-28-2009 13:51

ho inserito le _ per evitare link inappropriati

Matteo Dini 08-28-2009 13:55

Prova a mettere così e fammi sapere:

UP

nicola_10 08-28-2009 14:00

niente.... ho sostituito con le nuove stringhe ma nulla :confused::confused::confused:

Matteo Dini 08-28-2009 14:04

Proviamo a togliere il rewrite base...

Metti questo:

codice:

<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^gommeblog.it [NC]
RewriteRule ^(.*)$ http://www.gommeblog.it/$1 [L,R=301]
</IfModule>

Fammi sapere ...

Altrimenti devi andare nel pannello di amministrazione di Apache ed impostare il virtual host con due differenti hostname (servername o alias..)

nicola_10 08-28-2009 14:09

# INIZIO Redirect con WWW
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^gommeblog.it [NC]
RewriteRule ^(.*)$ http://www.gommeblog.it/$1 [L,R=301]
# FINE Redirect con WWW


NIENTE........:confused::confused::confused::confu sed:.non ci capisco una maz**a


Tutti gli orari sono GMT +2. Attualmente sono le 22:11.


Copyright IKONOS sas 2008-{2}


Content Relevant URLs by vBSEO 3.2.0