Results 1 to 1 of 1

Thread: htaccess e redirect

  1. #1
    Warrant Officer dariuz's Avatar
    Join Date
    Jun 2004
    Location
    Padova (PD!)
    Posts
    3.384

    Default htaccess e redirect

    son una paio di giorni che sbatto la testa sul seguente questito e spero qualcuno possa aiutarmi :

    io un una pagina web http://www.miosito.it/pagina.html

    il mio scopo è far si che sia che un utente digiti

    http://www.miosito.it/pagina.html
    http://www.miosito.it/pagina
    http://www.miosito.it/pagina/
    http://www.miosito.it/pagina.html/

    sul suo browser compaia
    http://www.miosito.it/pagina/

    (e ovviamente visualizzi la pagina html)

    ora io son riuscito a fare in modo che qualsiasi dicitura si usa di quelle sopra compare la corretta pagina html e nella barra dei link compare la dicitura giusta senza estensione ma purtroppo anche senza lo / finale

    con il seguente codice

    Code:
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.+)/$ /$1 [R=permanent,QSA]
    
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{THE_REQUEST} ^GET\ /[^?\s]+\.html
    RewriteRule (.*)\.html$ /$1 [L,R=301]
    come diavolo faccio ad inserire sto benedetto / finale ? (credo di dover lavorare sulle ultime due linee di codice a non so che fare)
    (le mie conosceze di script derivano tutte da google siate gentili :P
    Last edited by dariuz; 20th February 2014 at 12:55.
    -He who makes a beast of himself, gets rid of the pain of being a man
    -I pity those that don't drink, for when they wake up in the morning, thats as good as they're going to feel all day!
    -Silence is golden but duct tape is silver

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
[Output: 38.02 Kb. compressed to 32.38 Kb. by saving 5.64 Kb. (14.83%)]