|
|
|
![]() |
|
Strumenti |
![]() |
#1 |
Senior Member
Iscritto dal: Apr 2003
Città: Rimini
Messaggi: 3970
|
[HELP] Redirect http://dominio.com --> http://www.dominio.com
Pongo una semplice, spero, domanda :
Come faccio x far si che all'accesso del sito digitando dominio.com mi vada automaticamente e subito su http://www.dominio.com ? Mi spiego meglio... Se io digito, x es, libero.it vedo ke il link si trasforma subito in http://www.libero.it... Nel mio server, invece, se digito dominio.com il link si trasforma semplicemente in http://dominio.com... GRAZIE
__________________
Powered by Apple Macbook Pro Retina |
![]() |
![]() |
![]() |
#2 |
Senior Member
Iscritto dal: Jan 2002
Città: Imola
Messaggi: 1116
|
Con Apache -> Alias
|
![]() |
![]() |
![]() |
#3 | |
Senior Member
Iscritto dal: Apr 2003
Città: Rimini
Messaggi: 3970
|
Quote:
Perchè ho già provato le 2 combinazioni 1) ServerName dominio.com ServerAlias www.dominio.com oppure 2) ServerName www.dominio.com ServerAlias dominio.com Ma nn cambia nulla....
__________________
Powered by Apple Macbook Pro Retina |
|
![]() |
![]() |
![]() |
#4 |
Member
Iscritto dal: Jul 2004
Città: Aosta
Messaggi: 130
|
Fai un nuovo contenitore virtualhost dominio.it e dentro ci metti un solo index.html con dentro questa riga:
Codice:
<meta HTTP-EQUIV="REFRESH" content="0; url=http://www.dominio.com"> Edit: beh chiaramente non solo quella riga, anche i soliti [html][HEAD] ecc... ![]()
__________________
"Not all men who drink are poets. Some of us drink because we aren't poets." bionicoz@bionicoz.biz - PGP Key: bionicoz.asc |
![]() |
![]() |
![]() |
#5 |
Member
Iscritto dal: Jul 2004
Città: Aosta
Messaggi: 130
|
Però, visto che mi hai incuriosito, ho controllato se libero o tiscali usassero il sistema che ti ho illustrato io, e ho scoperto che usano il "301 Redirect". Come fare te lo incollo qui sotto in inglese. ciao.
So, how do you do a 301 Redirect? It's actually quite simple on a website using a Unix server: 1. Locate or create a .htaccess file on your server. Your .htaccess file gives search engine robots instructions on security and redirects. 2. If you don't have an .htaccess file on your server, you can easily create one using a text file. Name it ".htaccess" 3. If there is already an .htaccess file scroll down past the code that is already there and begin your new redirect instructions. 4. Put in your redirect information, which should look like this: redirect 301 /directory/file.html http://www.domainame.com/directory/file.html *Note: The first part "/directory/file.html" is the location of the file being moved and the second part "http://www.domainame.com/directory/file.html" is where the file is being moved. 5. Upload the file to your server.
__________________
"Not all men who drink are poets. Some of us drink because we aren't poets." bionicoz@bionicoz.biz - PGP Key: bionicoz.asc |
![]() |
![]() |
![]() |
#6 |
Senior Member
Iscritto dal: Apr 2003
Città: Rimini
Messaggi: 3970
|
uhmm... c'è qlc ke nn va....
ho creato nella document-root il file .htacess (640 root:root) con dentro questo : redirect 301 index.htm http://www.dominio.com/index.htm ma nn accade nulla... ho provato anke col path assoluto : redirect 301 /home/user/web/index.htm http://www.missangie.net/index.htm Idee ? Dov'ho sbagliato ? TNK
__________________
Powered by Apple Macbook Pro Retina |
![]() |
![]() |
![]() |
#7 |
Member
Iscritto dal: Jul 2004
Città: Aosta
Messaggi: 130
|
controlla che in httpd.conf "AllowOverride" abbia valore "All"
__________________
"Not all men who drink are poets. Some of us drink because we aren't poets." bionicoz@bionicoz.biz - PGP Key: bionicoz.asc |
![]() |
![]() |
![]() |
#8 |
Member
Iscritto dal: Jul 2004
Città: Aosta
Messaggi: 130
|
Se te la devo dire tutta ho sempre odiato anche io i .htaccess.
fai cosi, inserisci questo codice in dominio.it/index.php (mi pare che tu ce l'abbia installato php no?) Codice:
<?php header("HTTP/1.1 301 Moved Permanently"); header("Location: http://www.dominio.it"); exit(); ?> ![]()
__________________
"Not all men who drink are poets. Some of us drink because we aren't poets." bionicoz@bionicoz.biz - PGP Key: bionicoz.asc |
![]() |
![]() |
![]() |
#9 | |
Senior Member
Iscritto dal: Apr 2003
Città: Rimini
Messaggi: 3970
|
Quote:
Ultima cosina però... Come mai mi funziona SOLO se uso il file index.HTML mentre se uso index.HTM mi da il seguente errore : "Raggiunto il limite di ridirezioni per questo indirizzo. Impossibile caricare la pagina richiesta"
__________________
Powered by Apple Macbook Pro Retina Ultima modifica di The X : 06-02-2005 alle 13:22. |
|
![]() |
![]() |
![]() |
#10 |
Member
Iscritto dal: Jul 2004
Città: Aosta
Messaggi: 130
|
Il perché non te lo so dire, ma se ti crea problemi puoi sempre modificare il codice così:
Codice:
<?php header("HTTP/1.1 301 Moved Permanently"); header("Location: http://www.dominio.it/index.htm"); exit(); ?>
__________________
"Not all men who drink are poets. Some of us drink because we aren't poets." bionicoz@bionicoz.biz - PGP Key: bionicoz.asc |
![]() |
![]() |
![]() |
#11 |
Senior Member
Iscritto dal: Apr 2003
Città: Rimini
Messaggi: 3970
|
Già... ma se faccio così appare nel url anke la dicitura index.htm ed io voglio ke c sia solo il nome del dominio ^_^
Guarderò nei conf d apache....
__________________
Powered by Apple Macbook Pro Retina |
![]() |
![]() |
![]() |
Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 20:05.