Home › Forum › Problemi Vari con WP › Installazione WP in apposita directory
-
AutorePost
-
-
9 Luglio 2008 alle 20:25 #7221EliasPartecipante
Ciao,
volevo sapere se installo WP in una directory del server, ad esempio “blog”, mentre la pagina principale del sito index.php è nella root principale posso fare in modo che il codice php presente nella pagina principale, tipo “<?php bloginfo(‘name’); ?>” prenda informazioni dal db creato per WP?
Come devo modificare il cosice?
Questo perchè la index.php principale del sito l’ho creata duplicando la index.php del tema di defaul, e vorrei mettere on line il sito con WP in un’apposita cartella cosi da testare nuove versioni installandole in altre cartelle.
Spero di essermi spiegato….
Grazie
-
9 Luglio 2008 alle 23:29 #55663ArturoPartecipante
se cerchi nel forum ci sono discussioni che spiegano anche con esempi funzionanti come utilizzare le funzioni di wp fuori dalla directory d’installazione, in questo modo puoi fare quello che dici tu, avere la home del sito come index.php che usa le funzioni di wp installato in /blog/.
-
10 Luglio 2008 alle 9:44 #55670EliasPartecipante
….ho cercato ma forse non inserisco i giusti parametri nel motore di ricerca…..
un aiutino?
Grazie
-
13 Luglio 2008 alle 17:15 #55780EliasPartecipante
Dovrei aver risolto, ma scrivo la procedura utilizzata in modo che mi potete confermare se è tutto giusto oppure se devo modificare qualcosa per trarne migliorie….. e poi se è giusto può servire da tutorial a che si ha o avrà il mio stesso problema
Allora in breve volevo avere WP installato in una cartella e non nella root principale del mio spazio web e lasciare solo la index.php al di fuori della directory di WP; ho proceduto in questo modo:
1) installato WP nella directory http://www.miosito.it/wordpress
2) ho copiato il file index.php, che si trova nella directory principale di WP dopo l’installazione (http://www.miosito.it/wordpress) nella root del mio spazio web (http://www.miosito.it/index.php)
3) o moificato il file index.php copiato da cosà¬:
<?php
/* Short and sweet */
define(‘WP_USE_THEMES’, true);
require(‘./wp-blog-header.php’);
?>
a cosà¬:
<?php
/* Short and sweet */
define(‘WP_USE_THEMES’, true);
require(‘./wordpress/wp-blog-header.php’);
?>
3) mi sono loggato al pannello di controllo di WP e ho creato un pagina chiamata “home” tramite template (quindi andando in >Scrivi >Pagina
4) sempre dal panello di controllo ho cambiato le seguenti impostazioni:
> Impostazioni >Generale
– Indirizzo WordPress (URL): http://www.miosito.it/wordpress
– Indirizzo del blog (URL): http://www.miosito.it
> Impostazioni >Lettura
– Visualizzazione pagina iniziale spunta su pagina statica
– Pagina iniziale: Home
– Pagina articoli: news
Ho salvato tutte le nuove impostazioni e sembra funzionare a meraviglia
-
13 Luglio 2008 alle 18:56 #55781
-
13 Luglio 2008 alle 19:20 #55782EliasPartecipante
htaccess sotto la directory WP
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wp/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wp/index.php [L]
</IfModule>
# END WordPress
htaccess sotto la root del mio spazio web
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
perchè questa differenza?
-
13 Luglio 2008 alle 19:31 #55783wollyAmministratore del forum
http://www.wpitaly.it/wiki/Main/SpostareWordPress punto 2
non credo debbano esserci 2 file htaccess
-
14 Luglio 2008 alle 6:39 #55784EliasPartecipante
Risolto il problema!
Nel mio tema personalizzato avevo modificato l’index.php per la home page per cui non avevo creato una pagina dal pannello di amministrazione di WP, per questo sballava tutto il css… allora ho trasformato l’index.php in home_page.php e lo trasformata in un template di pagina, a questo punto ho creato una pagina con template home_page.php e impostata, in opzione di lettura, come pagina principale e tutto va a meraviglia!
Se può essere utile tutto questo a qualcuno ne sono felice!
(ma che fatica imparare….. ma ho una frase che riassume tutto questo “Chi vede dimentica chi legge ricorda chi fa impara“)
-
-
AutorePost
- Devi essere connesso per rispondere a questo topic.