Post
#1
|
|
|
Grupa: Zarejestrowani Postów: 38 Pomógł: 0 Dołączył: 15.06.2008 Ostrzeżenie: (0%)
|
Witam,
mam dużą prośbe o pomoc 2 sprawy 1. Kod ### BEZ KONCOWEK *.html ### RewriteEngine On RewriteRule ^index.html$ /index [L,R=301] RewriteRule ^([a-z-9-_]+)/index.html$ /$1/index [L,R=301] kawałek kodu z pliku .htaccess dlaczego jeśli wpisze www.photopaterek.pl/index wyskakuje mi wielokrotny wybór? lub http://photopaterek.pl/images/picture/Ludz...ople/slides/007 jeśli dobrze sie domyslam z kodu to powinno działac przynajmniej dla plików index ale jak zrobić aby działało dla indexów jak i pozostałych? 2. Kod RewriteEngine On RewriteRule ^Skrzynia...Box/([a-z0-9-_]+).html$ /images/picture/Skrzynia...Box/slides/$1.html [L,R=301] całe portfolio jest zrobione na plikach html i chciałbym aby w linkach nie pokazywały się pełne ściezki dostepu dlaczego powyższy kod nie działa? podaję tez całą zawartość pliku htaccess bo moze jedno z drugim sie dryzie... Kod ### BEZ KONCOWEK *.html ### RewriteEngine On RewriteRule ^index.html$ /index [L,R=301] RewriteRule ^([a-z-9-_]+)/index.html$ /$1/index [L,R=301] RewriteEngine On RewriteRule ^Skrzynia...Box/([a-z0-9-_]+).html$ /images/picture/Skrzynia...Box/slides/$1.html [L,R=301] # # WYMUSZONY SLASH # RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !(.*)/$ RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1/ [L,R=301] # # STANDARDY # AddDefaultCharset iso-8859-2 # # REMOVE LAST-MODIFIED HEADER # <FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$"> Header unset Last-Modified </FilesMatch> # # LINK BEZ WWW # RewriteEngine On RewriteCond %{HTTP_HOST} ^www.photopaterek.pl(.*) [NC] RewriteRule ^(.*)$ http://photopaterek.pl/$1 [R=301,L] # #USTAWIENIA CACHE STRONY # <IfModule mod_headers.c> <FilesMatch "\.(gif)$"> Header set Cache-Control "max-age=7257600, public" </FilesMatch> <FilesMatch "\.(png)$"> Header set Cache-Control "max-age=7257600, public" </FilesMatch> <FilesMatch "\.(psd)$"> Header set Cache-Control "max-age=7257600, public" </FilesMatch> <FilesMatch "\.(ico)$"> Header set Cache-Control "max-age=7257600, public" </FilesMatch> <FilesMatch "\.(jpg)$"> Header set Cache-Control "max-age=7257600, public" </FilesMatch> <FilesMatch "\.(jpeg)$"> Header set Cache-Control "max-age=7257600, public" </FilesMatch> <FilesMatch "\.(swf)$"> Header set Cache-Control "max-age=7257600, public" </FilesMatch> <FilesMatch "\.(flv)$"> Header set Cache-Control "max-age=7257600, public" </FilesMatch> <FilesMatch "\.(js)$"> Header set Cache-Control "max-age=14515200, public" </FilesMatch> <FilesMatch "\.(css)$"> Header set Cache-Control "max-age=604800, public" </FilesMatch> <FilesMatch "\.(html)$"> Header set Cache-Control "max-age=10800, public, must-revalidate" </FilesMatch> <FilesMatch "\.(htm)$"> Header set Cache-Control "max-age=10800, public, must-revalidate" </FilesMatch> <FilesMatch "\.(txt)$"> Header set Cache-Control "max-age=10800, public, must-revalidate" </FilesMatch> <FilesMatch "\.(shtml)$"> Header set Cache-Control "max-age=10800, public, must-revalidate" </FilesMatch> <FilesMatch "\.(txt)$"> Header set Cache-Control "max-age=10800, public, must-revalidate" </FilesMatch> <FilesMatch "\.(xml)$"> Header set Cache-Control "max-age=10800, public, must-revalidate" </FilesMatch> <FilesMatch "\.(pdf)$"> Header set Cache-Control "max-age=604800, public" </FilesMatch> <FilesMatch "\.(swf)$"> Header set Cache-Control "max-age=604800, public" </FilesMatch> </IfModule> # # STRONY BLEDOW HTTP # ErrorDocument 400 http://photopaterek.pl/400.html ErrorDocument 401 http://photopaterek.pl/401.html ErrorDocument 403 http://photopaterek.pl/403.html ErrorDocument 404 http://photopaterek.pl/404.html ErrorDocument 500 http://photopaterek.pl/500.html gorąco prosze o pomoc Ten post edytował Zumi 31.08.2010, 18:09:27 |
|
|
|
![]() |
Post
#2
|
|
|
Grupa: Zarejestrowani Postów: 159 Pomógł: 43 Dołączył: 8.03.2009 Ostrzeżenie: (0%)
|
A pousuwałeś flagi R tak jak erix pisał ? W tym .htaccess masz zdublowane
Kod <FilesMatch "\.(txt)$"> Tu nie powinno być / na początku adresów na które przepisujesz: Kod RewriteEngine On RewriteRule ^index$ index.html [L] RewriteRule ^([[:print:]]+)/index$ $1/index.html [L] btw. po co przed każdą komendą przepisania maszRewriteEngine On ? edit: zapomniałem, ten wielokropek ... działa, bo znak kropki mieści się w zbiorze dowolnego znaku, ale będzie też dopasowywało np.: SkrzyniaLOLBox Ten post edytował AdIoS_Neo 3.09.2010, 13:58:32 |
|
|
|
Post
#3
|
|
|
Grupa: Zarejestrowani Postów: 38 Pomógł: 0 Dołączył: 15.06.2008 Ostrzeżenie: (0%)
|
A pousuwałeś flagi R tak jak erix pisał ? W tym .htaccess masz zdublowane Kod <FilesMatch "\.(txt)$"> Tu nie powinno być / na początku adresów na które przepisujesz: Kod RewriteEngine On RewriteRule ^index$ index.html [L] RewriteRule ^([[:print:]]+)/index$ $1/index.html [L] btw. po co przed każdą komendą przepisania maszRewriteEngine On ? edit: zapomniałem, ten wielokropek ... działa, bo znak kropki mieści się w zbiorze dowolnego znaku, ale będzie też dopasowywało np.: SkrzyniaLOLBox Kod <FilesMatch "\.(txt)$"> już usunąłem ten index dalej nie działa (IMG:style_emoticons/default/sad.gif) czyli ten wielokropek jest niepoprawny? nazwy folderów zawierają te 3 kropki... tak samo jak nazwy galerii tak wygląda teraz mój htaccess Kod # # SKRACANIE LINKOW - POKAZ FOTO # RewriteEngine On RewriteRule ^Abstrakcja...Abstraction/PokazFoto([a-z0-9-_]+)$ /images/picture/Abstrakcja...Abstraction/slides/$1.html [L] RewriteRule ^Fauna...Animals/PokazFoto([a-z0-9-_]+)$ /images/picture/Fauna...Animals/slides/$1.html [L] RewriteRule ^Flora...Plants/PokazFoto([a-z0-9-_]+)$ /images/picture/Flora...Plants/slides/$1.html [L] RewriteRule ^Krajobrazy...Landscapes/PokazFoto([a-z0-9-_]+)$ /images/picture/Krajobrazy...Landscapes/slides/$1.html [L] RewriteRule ^Ludzie...People/PokazFoto([a-z0-9-_]+)$ /images/picture/Ludzie...People/slides/$1.html [L] RewriteRule ^Miejskie...Urban/PokazFoto([a-z0-9-_]+)$ /images/picture/Miejskie...Urban/slides/$1.html [L] RewriteRule ^Photoshop...Photoshop/PokazFoto([a-z0-9-_]+)$ /images/picture/Photoshop...Photoshop/slides/$1.html [L] RewriteRule ^Skrzynia...Box/PokazFoto([a-z0-9-_]+)$ /images/picture/Skrzynia...Box/slides/$1.html [L] # # SKRACANIE LINKOW - GALERIE # RewriteEngine On RewriteRule ^Abstrakcja...Abstraction$ /images/picture/Abstrakcja...Abstraction/index.html [L] RewriteRule ^Fauna...Animals$ /images/picture/Fauna...Animals/index.html [L] RewriteRule ^Flora...Plants$ /images/picture/Flora...Plants/index.html [L] RewriteRule ^Krajobrazy...Landscapes$ /images/picture/Krajobrazy...Landscapes/index.html [L] RewriteRule ^Ludzie...People$ /images/picture/Ludzie...People/index.html [L] RewriteRule ^Miejskie...Urban$ /images/picture/Miejskie...Urban/index.html [L] RewriteRule ^Photoshop...Photoshop$ /images/picture/Photoshop...Photoshop/index.html [L] RewriteRule ^Skrzynia...Box$ /images/picture/Skrzynia...Box/index.html [L] # # STRONY BLEDOW HTTP # ErrorDocument 400 http://photopaterek.pl/NieprawidloweZapytanie ErrorDocument 401 http://photopaterek.pl/NieautoryzowanyDostep ErrorDocument 403 http://photopaterek.pl/DostepZabroniony ErrorDocument 404 http://photopaterek.pl/NieZnaleziono ErrorDocument 500 http://photopaterek.pl/WewnetrznyBladSerwera # # SKRACANIE LINKOW - STRONY BLEDOW HTTP # RewriteEngine On RewriteRule ^NieprawidloweZapytanie$ /400.shtml [L] RewriteRule ^NieautoryzowanyDostep$ /401.shtml [L] RewriteRule ^DostepZabrooniony$ /403.shtml [L] RewriteRule ^NieZnaleziono$ /404.shtml [L] RewriteRule ^WewnetrznyBladSerwera$ /500.shtml [L] # # STANDARDY # AddDefaultCharset iso-8859-2 #DirectoryIndex PrzerwaTechniczna # # SKRACANIE LINKOW - ROZNE # RewriteEngine On RewriteRule ^PrzerwaTechniczna$ /przerwa_techniczna.html [L] # # REMOVE LAST-MODIFIED HEADER # <FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf|txt|psd)$"> Header unset Last-Modified </FilesMatch> # # LINK BEZ WWW # RewriteEngine On RewriteCond %{HTTP_HOST} ^www.photopaterek.pl(.*) [NC] RewriteRule ^(.*)$ http://photopaterek.pl/$1 [R=301,L] # #USTAWIENIA CACHE STRONY # <IfModule mod_headers.c> <FilesMatch "\.(gif)$"> Header set Cache-Control "max-age=7257600, public" </FilesMatch> <FilesMatch "\.(png)$"> Header set Cache-Control "max-age=7257600, public" </FilesMatch> <FilesMatch "\.(psd)$"> Header set Cache-Control "max-age=7257600, public" </FilesMatch> <FilesMatch "\.(ico)$"> Header set Cache-Control "max-age=7257600, public" </FilesMatch> <FilesMatch "\.(jpg)$"> Header set Cache-Control "max-age=7257600, public" </FilesMatch> <FilesMatch "\.(jpeg)$"> Header set Cache-Control "max-age=7257600, public" </FilesMatch> <FilesMatch "\.(swf)$"> Header set Cache-Control "max-age=7257600, public" </FilesMatch> <FilesMatch "\.(flv)$"> Header set Cache-Control "max-age=7257600, public" </FilesMatch> <FilesMatch "\.(js)$"> Header set Cache-Control "max-age=14515200, public" </FilesMatch> <FilesMatch "\.(css)$"> Header set Cache-Control "max-age=604800, public" </FilesMatch> <FilesMatch "\.(html)$"> Header set Cache-Control "max-age=10800, public, must-revalidate" </FilesMatch> <FilesMatch "\.(htm)$"> Header set Cache-Control "max-age=10800, public, must-revalidate" </FilesMatch> <FilesMatch "\.(txt)$"> Header set Cache-Control "max-age=10800, public, must-revalidate" </FilesMatch> <FilesMatch "\.(shtml)$"> Header set Cache-Control "max-age=10800, public, must-revalidate" </FilesMatch> <FilesMatch "\.(xml)$"> Header set Cache-Control "max-age=10800, public, must-revalidate" </FilesMatch> <FilesMatch "\.(pdf)$"> Header set Cache-Control "max-age=604800, public" </FilesMatch> <FilesMatch "\.(swf)$"> Header set Cache-Control "max-age=604800, public" </FilesMatch> </IfModule> pytanko ostatnie... czy Kod RewriteEngine On RewriteRule ^PrzerwaTechniczna$ /przerwa_techniczna.html [L] to i to Kod DirectoryIndex PrzerwaTechniczna powinno działac? bo niestety nie działa? co jeszcze może być źle w tym pliku? |
|
|
|
Zumi htaccess + mod_rewrite błąd składni? 31.08.2010, 18:06:09
erix Cytatwww.photopaterek.pl/index wyskakuje mi wielok... 31.08.2010, 20:16:25 
Zumi CytatCytat
Cytatwww.photopaterek.pl/index wyskakuj... 1.09.2010, 17:58:11
AdIoS_Neo KodRewriteRule ^Skrzynia...Box/([a-z0-9-_... 1.09.2010, 20:40:02 
Zumi Cytat(AdIoS_Neo @ 1.09.2010, 21:40:02... 2.09.2010, 19:18:24 ![]() ![]() |
|
Aktualny czas: 10.06.2026 - 10:02 |