Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [PHP][HTML] przekierowanie do odpowiedniego folderu
Forum PHP.pl > Forum > Przedszkole
harbii
W pliku .htaccess mam takie zapisy odnośnie przekierowań.
  1. RewriteEngine On
  2. # uncomment the following line, if you are having trouble
  3. # getting no_script_name to work
  4.  
  5.  
  6. #RewriteBase /
  7.  
  8. # Przekierowanie na https:
  9. #RewriteCond %{HTTPS} off
  10. #RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=302,L]
  11.  
  12.  
  13. #RewriteRule ^(.+)/$ $1 [R=301,L]
  14.  
  15. # we skip all files with .something
  16. #RewriteCond %{REQUEST_URI} \..+$
  17. RewriteCond %{REQUEST_FILENAME} -f [OR]
  18. RewriteCond %{REQUEST_FILENAME} -d
  19. #RewriteCond %{REQUEST_URI} !\.html$
  20. RewriteRule .* - [L]
  21.  
  22. # we check if the .html version is here (caching)
  23. #RewriteRule ^$ index.html [QSA]
  24. #RewriteRule ^([^.]+)$ $1.html [QSA]
  25. #RewriteCond %{REQUEST_FILENAME} !-f
  26.  
  27. # no, so we redirect to our front web controller
  28. RewriteRule ^(.*)$ index.php [QSA,L,E=noconntimeout:1]
  29. </IfModule>
  30.  


w momencie jak klikam na jakiś link zamistast:
127.0.0.1/strona/blog1/index.php
otwiera mi:
127.0.0.1/blog1/index.php

czy można to w pliku .htaccess ustawić aby doklejało cały adres?
luki100011
A jaki adres jest faktycznie w linku ? z "strona" czy też bez ?
harbii
Otwieram stronę
127.0.0.1/strona/

I mam link do bloga powinien wyglądac tak: https://127.0.0.1/strona/blog1/index.php
a wygląda tak:
https://127.0.0.1/blog1/index.php
luki100011
A nie możesz dodać "strona" ?
To twój skrypt bloga czy gotowy ?
harbii
to jest tylko przyklad.
chodzi o to aby wymusić doklejanie początku adresu
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.