Visualizzazione dei risultati da 1 a 8 su 8

Discussione: index.php e index.html

  1. #1

    index.php e index.html

    Salve a tutti , spero di non essere off-topic.

    Vorrei passare da una home page statica ad una dinamica , ma vorrei che , mentre faccio le prove su index.php ( quindi io ci accedo scrivendo direttamente l'url www.miosito.it/index.php ) , gli utenti visualizzassero la vecchia homepage index.html ( alla quale gli utenti dovrebbero arrivare digitando semplicemente l'url www.miosito.it ).

    Come faccio a specificare che fra le due index contenute nella cartella principale venga visualizzata la index.html?

    Grazie e se sono OT scusate di nuovo.

  2. #2
    Ti basta inserire nell'index.php un codice tipo:

    Codice PHP:
    <?php include(dirname(__FILE__) . '/index.html'); ?>

  3. #3
    Utente di HTML.it L'avatar di telegio
    Registrato dal
    Sep 2001
    Messaggi
    2,592
    io di solito in questi casi rinomino la mia index.php in ___index.php o --index.php
    quando devo pubblicare rinomino il file e il gioco č fatto..
    AH!!! ovvio che se ci sono dei link alla index.php non funzioneranno..



  4. #4
    ho googlato un po' e mi pare di aver capito che un'altra strada potrebbe essere modificare il file htaccess.

    Questo č il mio :

    codice:
    ##
    # @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
    Qualcuno saprebbe dirmi come modificarlo?

  5. #5
    Originariamente inviato da telegio
    io di solito in questi casi rinomino la mia index.php in ___index.php o --index.php
    quando devo pubblicare rinomino il file e il gioco č fatto..
    AH!!! ovvio che se ci sono dei link alla index.php non funzioneranno..


    il problema č proprio quello : sto facendo una installazione/configurazione di joomla e non posso essere certo che modificando il nome della index.php il tutto vada ugualmente a buon fine.

  6. #6

  7. #7
    grazie. ho provato ad aggiungere la riga

    codice:
    DirectoryIndex index.html
    ma nada , continua a preferire index.php

    Ci sarā mica qualche riga nel codice che ho scritto che fornisce al server una indicazione contraria a questa?

  8. #8
    Utente di HTML.it L'avatar di clasku
    Registrato dal
    Aug 2006
    Messaggi
    3,197
    Hai riavviato Apache dopo la modifica?

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.